select audio at runtime?

Discussion and feedback on Construct 2

Post » Tue Nov 08, 2016 7:05 pm

is it possible to select audio at runtime?

I'm teaching a sound design class and I'm making a small little program in C2 but I want students to replace all the sound files with ones they create. Ideally I'd like them to drop them into a folder replacing my placeholder sfx. I'm Exporting to HTML5 but it looks as though the Sound folder is encrypted or encapsulated into a .js?

any suggestions?
B
98
S
32
G
16
Posts: 1,204
Reputation: 16,715

Post » Tue Nov 08, 2016 7:10 pm

The audio files are all put in a media folder and can be replaced freely before or after export. The easiest way would be to require the same file names as your example files. Otherwise, you'll have to pull file names from an XML list or something.
B
103
S
38
G
19
Posts: 962
Reputation: 17,996

Post » Tue Nov 08, 2016 7:26 pm

@C-7
aren't sound files loaded into memory? how do you refresh?
the only folder I see in the export directory is /images. I know you can make a subfolder under Files/ but you can't select that folder when you Audio.Play()

EDIT nevermind those first two questions.. duh.. I can have students drop the files in before they run the program. but still, where do they copy them to?
B
98
S
32
G
16
Posts: 1,204
Reputation: 16,715

Post » Tue Nov 08, 2016 7:52 pm

okay.. not sure what happened.. I reExported and now I see the media folder... I have both versions though, the first time there is NO media folder! I have no clue why..

thanks @C-7!
B
98
S
32
G
16
Posts: 1,204
Reputation: 16,715

Post » Thu Nov 10, 2016 12:55 am

No problem! Glad it got cleared up! I suppose at runtime you could potentially make a call to preload or something, but there's no real use, just have them do it in first.

Glad I could help!
B
103
S
38
G
19
Posts: 962
Reputation: 17,996


Return to Construct 2 General

Who is online

Users browsing this forum: Lancifer, Rei TheMartianCat and 9 guests