code wav => mid

Posted By: ayks

code wav => mid - 11/10/09 01:52

hi,
i found this code in aum66 (its for stop a wav with a slow descent of the volume)

Quote:
var loop_handle;
var loop_volume = 100;
sound atmosphere_wav = "atmosphere.wav";
function loop_startup()
{
loop_handle = snd_loop(atmosphere_wav, 80, 0);
while (!key_f) {wait (1);}
while (loop_volume > 1)
{
snd_tune(loop_handle, loop_volume, 0, 0);
loop_volume -= 0.5 * time_step; // 0.5 = vitesse de fondu
wait (1);
}
snd_stop (loop_handle);
}


but looks like it works only with .wav and not with .mid, tried to change some things like media instead of sound but it dont works.
i got a normal "wrong type invalid file".

so my question is : is there a solution with only some change to make it work for .mid and if yes, which one.
thx
Posted By: delinkx

Re: code wav => mid - 11/10/09 03:16

well, snd_loop takes a SOUND structure. and the file formats supported here is .wav and .ogg. Media play supports more file types.

the fastest solution is to convert ur midi file to wave. u can use audacity (opensource) to do this.
Posted By: Spirit

Re: code wav => mid - 11/10/09 09:21

Better convert it to ogg, that takes up less space.

MID is not a sound format but an instrument format.
Posted By: ayks

Re: code wav => mid - 11/10/09 11:17

ok thx for the tips, i will try audacity now and will edit then for say the result.

i tried to convert to my .mid to .wav yesterday with an online converter but i got something like 17mo for a 7ko mid oO

hope i can convert mid to ogg with audacity.
and tx for the last info about mid :l

edit damn, both in normal quality take too much space, i will try to find a way to do it with mid -.

re-edit : i finally did it, not with a converter but with a direct record with audacity, cause looks like he has some problem with mid..

© 2024 lite-C Forums