Questions about audio

Get help using Construct 2

Post » Sat Dec 06, 2014 1:03 pm

1. How do I randomly pick from a set of music files to play (not looping) at start of layout and then after it finishes, select another one from same set, and so on.

2. If I have a 5mb ogg file and import it to my game, can I still make the size of ogg file smaller after it is added to the capx? bottomline is I don't want a big capx size and I would like to know how to make the sound files as small as possible, possibly as small 200kb per ogg file.
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Sat Dec 06, 2014 4:00 pm

anyone?
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Sat Dec 06, 2014 4:27 pm

I would use:
play by name "your_sound_files_renamed_to_use_an_index"&int(random(howmanysoundfilesyougot))
>system wait howeverlongthatfileis ms, play foo
Image ImageImage
B
169
S
50
G
173
Posts: 8,319
Reputation: 110,282

Post » Sat Dec 06, 2014 4:33 pm

if you download an ogg converter or use Audacity your can set the file compression quality from 1-10. With 1 being the lowest quality and 10 being the best quality. I would recommend quality 4 as that will be the best size to sound ration.. quality lower than 4 get bad pretty fast and leaves all sorts of sound artifacts...
B
98
S
32
G
16
Posts: 1,204
Reputation: 16,715

Post » Sat Dec 06, 2014 4:36 pm

media human has a good free app..

download the converter here...

http://www.mediahuman.com/download.html
B
98
S
32
G
16
Posts: 1,204
Reputation: 16,715

Post » Sun Dec 07, 2014 4:28 am

@newt

C: System: At start of layout <----I think this is wrong but not sure what to replace it with
A: Audio: Play int(random(5)) from Music
A: System: Wait "Audio.Duration" secs <--- duration can't take 0 parameters, tried "Audio.Playbacktime" same issue

How can I set the duration if the music files are not same duration?

@jobel
thanks. please check your pm.
B
16
S
7
Posts: 301
Reputation: 2,726

Post » Sun Dec 07, 2014 5:30 am

Audio.Duration("yourtag")
Image ImageImage
B
169
S
50
G
173
Posts: 8,319
Reputation: 110,282

Post » Sun Dec 07, 2014 6:55 am

it all depends on the duration of the audio.

a rough estimate
1 min audio uncompressed (like wav or aif) = 10MB
1 min audio compressed (mp3, ogg) = 1MB

but with ogg you can bring the compression down with quality and make the file sizes smaller.
http://www.vorbis.com/faq/#quality

you have to play with this setting.. but you are probably not going get much smaller than a 1MB/per min and sound good. Depending on what it is you might be able to get down to 900/800kb per min...
B
98
S
32
G
16
Posts: 1,204
Reputation: 16,715

Post » Wed Aug 16, 2017 2:12 pm

Message: MathewHarrison can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
jobel wrote:it all depends on the duration of the audio.

a rough estimate
1 min audio uncompressed (like wav or aif) = 10MB
1 min audio compressed (mp3, ogg) = 1MB

but with ogg you can bring the compression down with quality and make the file sizes smaller.
http://www.vorbis.com/faq/#quality

you have to play with this setting.. but you are probably not going get much smaller than a 1MB/per min and sound good. Depending on what it is you might be able to get down to 900/800kb per min...

Thank you for your help.
B
1
Posts: 5
Reputation: 135


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 28 guests