Is there a way to play Arrays as a PCM sample?

The context
I would like a way to use an array as a PCM sample but I don’t know at all how to do that I have no idea :confused:
I tryed to search “PCM sample sound from Lua” in a Internet Browser, I tryed multiples variants “custom PCM sound from Lua code”… But I never found anything that can help me :frowning: Everytimes I see something tlking about, it say always “The only way to do in Lua is calling code from another Programmation Language” :rage:
So… If I want to do that, in theory in sould have (the PCM sample with his sample-rate and) a way to write code from another language :face_with_monocle:
I don’t accept plugins but I can make a plugin if you tell me the code to put in! :slightly_smiling_face:
I’m pratically lost :frowning_face: If you have any idea to achieve this, PLEASE reply to this topic! And please don’t close this topic :disappointed:

For what I want to use?

I’d like to use this for a game which will have computers that could run random/custom sounds made by players (or made by the script that players made) :slight_smile:

In summary
I’m looking for a way to use arrays as PCM sample :slight_smile:

Use this :arrow_down: if you don’t know what is PCM

1 Like

Nope, you can’t manipulate audio data directly. This is most likely never going to happen as you could then circumvent the audio moderation system by just encoding it as audio data directly in your scripts.

There isn’t any way even with a plugin? Or can we writte in another Programmation Language that supports that? I think there is a way :thinking:
I didn’t think about audio moderation…

There is no method in Roblox to manipulate audio in the way you have provided. Also there is no other programming language in Roblox other than Lua. The only tools developers have to manipulate audio is by using any of the following

image

But why Roblox would be so bad in audio?

It’s for safety. If developers could encode any audio into the engine, this would be abused by malicious developers and may potentially harm children. This is why every asset on Roblox is heavily moderated.

It’s also to avoid copyright issues.

Edit:
An exception would be creating custom audio in Roblox to upload to the website, but still get moderated after, this is allowed, but such feature is not in the Roadmap yet.

I think I found a way! It’s from an idea of the C64 audio-sound-chip
We can upload several audio sound (triangle, square, sine, sawtooth) and re-use this for anything! :slightly_smiling_face:
The only default: we can’t reproduce any sounds that we wants, it’s usefull for music (or beeping computers) but else there is no way to do PCM with that… maybe we can use the same trick as the C64 to give a PCM sample :thinking:
An example:


You have three channel that can to any waves, and with that, we can do music! (the filters would be provided by Roblox)
1 Like

Actually, you could upload sound smaples for your players and create an in-game audio editor. I have’t seen any acutal audio editors in Roblox games and this sounds like a great feature for a game. Just beware that this can be abused by players if they are able to procude any sounds that is not allowed on the platform. Your game can face some serious moderation.

Maybe, we should add a in-game sound moderation :thinking:
I don’t want to violate the Roblox’s law :slight_smile:

I don’t think this kind of system would be possible.

  1. There is no Roblox API for games to actually listen to what sounds sound like nor detect if it is violating a Roblox rule.

  2. Automation is not an easy thing, you will need actual players to moderate sounds.

I know, for the time that my games aren’t populars I can do myself but when they will be populars, I can ask my friends to check :slight_smile:
Or recruite someone else that we can trust :123:

1 Like

There are MIDI players on Roblox which have been around for a while - they were much more common before user uploaded audio was a thing.

Before when I was 10, I made a programm in Scratch (I hate Scratch, now) that can do PCM samples of 8 values… It was very hard because Scratch is very poor for Sounds, it’s almost like Roblox, you must save (mp3,wav,…) sound, but there wasn’t any limits and the cost was only whih the pragramm will be heavier :grin:
In theory I should be able to do this in roblox since it require 8 sounds samples…

Hello would you mind sharing the scratch code?

Uh… You are trying to ask me if I could share the “code” (from Scratch 2) to make that?