Is this posible?
How can I play a sound added as binary data?
Printable View
Is this posible?
How can I play a sound added as binary data?
Is there a reason you aren't using sounds with the normal sound engine? They are added to your project automatically, so they are stored in the app the same way Binary Data would be. If you are trying to load a sound by filename on a mobile device, I don't think F2.5 can do it.
Yeah, Well I have a list of 60 sounds named from 1.ogg to 60.ogg , the thing is I want to play them with a single event line, like play: $Str(Var)+".ogg" , but I can't because CF doesn't recognize the binary files.
So I have to do 60 event lines to reproduce these sounds: If Var = 1 -> reproduce 1.ogg , If var = 2 -> reproduce 2.ogg etc...
Is there an alternative to do this?
mm, I don't know if this is what you want but you have a expression instead of pick a file in the play method did you try there?
so I recommend call you sounds something like s01, s02, s03, s04....s60
and in expression do something like: "s"+right$("00"+Str$("var"), 2)
Wait, so the "Play Sample from File" action works on mobile if you call a filename from Binary Data? I had it set up to play from file that was pointed to a folder, but it didn't seem to work on mobile. If this is true, then I wish I would have left my sound code the way it was. My Sound Test screen is currently doing the long way that AlanRuno described (an event for each sound file).
but isn't that impossible to do seeing as the "play sample from file"action is greyed out on the mobile exporters?
yes you are right, sorry I confuse myself, let me think about this.
What do you mean grayed out?
I am in Android mode and I select play samples from file, and select the file, so it gets added to the binary.
From there I can always call those files in my app ?
Unless I am missing something in the conversation >:)
sorry, i think i'm the one whose missing something. i assumed the android options where the same as the ios ones:o as it's greyed out on the ios exporter so u cant enter an expression for your sample. its funny that this thread just came up because i was just about to raise it as an issue for ios. because i'm in a similar dilemma & going crazy. i hav over 100+ sounds that need to be played & i also want to play them from a string all on one line referencing whats in the data elements, not on 100+ seperate lines. i don't understand why the many of the sound options are greyed out on ios? was it down to clickteam being lazy wen they did the exporter. or was there sum actual reason why?
it's really really inefficient.
Hmm... Switched to IOS and the Music is all grayed out. but never used that since I use Sample (music is for midi files if i remember correctly, that someone stated that a long time ago)
Samples are all there except for panning and channels.. but for the rest it's all there.. ? (only 5 grayed out for IOS (the pan ones))