
-----------------------------------
8749236
Sat May 28, 2011 7:01 pm

How do i play a sound when there is a music on going??
-----------------------------------
What is it you are trying to achieve?
i'm trying to play another sound without stop the sound that didn't finished..


What is the problem you are having?
Don't know how to do


Describe what you have tried to solve this problem
tried use process, procedure, PlayFile and PlayFileLoop..


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)




process test
    Music.PlayFileLoop ("Sounds/BGM.wav")
end test
fork test        % this used to run the music
Music.PlayFile ("Sounds/anysound.wav")           % this run anysound



Please specify what version of Turing you are using
Turing 4.1

-----------------------------------
Zren
Sat May 28, 2011 7:28 pm

RE:How do i play a sound when there is a music on going??
-----------------------------------
Read the docs.


Details   On the PC, different formats of music can play simultaneously. This means that a program might use a MIDI file as a background soundtrack and then use WAVE files for individual sound effects. The sound effects would not interfere with the background music. Playing a second music file with the same format as an already playing piece immediately halts the first piece and starts the second. This can be used to stop a single type of music by playing a short silent piece of music. 


In other words. Turing sucks. To get around it, use a different filetype for SFX and BGM. Eg: Mp3 for BGM and Wav for SFX.

-----------------------------------
8749236
Sat May 28, 2011 7:37 pm

RE:How do i play a sound when there is a music on going??
-----------------------------------
>.<
Thank you, i found out a new way..

process test
        Music.PlayFileLoop ("Distant Avalon.wav")
end test
fork test
delay (1)
put "a"
    Music.PlayFileReturn ("Sanguineous Soul.wav")
    delay(100)

the sound won't stop playing, but when second sound playing, it will cut down the first one, after it finished, first one keep playing until it is finished..

-----------------------------------
Zren
Sat May 28, 2011 7:49 pm

RE:How do i play a sound when there is a music on going??
-----------------------------------
Use a different filetype. Eg:



var chars, lastChars : array char of boolean
Input.KeyDown (chars)

fcn keyDown (c : char) : boolean
    result chars (c) and ~lastChars (c)
end keyDown

process playSound (filename : string)
    Music.PlayFile (filename)
end playSound

fork playSound ("Silkie - Planet X 

-----------------------------------
8749236
Wed Jun 01, 2011 4:14 pm

RE:How do i play a sound when there is a music on going??
-----------------------------------
tried, works well.. thank u : )

-----------------------------------
copthesaint
Thu Jun 02, 2011 12:16 am

Re: How do i play a sound when there is a music on going??
-----------------------------------
If you need to use multiple music files, you can use this program I made a long time ago :P. http://compsci.ca/v3/download.php?id=6631

*500*
