Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 A little sound problem
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
poomanchunk




PostPosted: Wed Jun 09, 2004 3:36 pm   Post subject: A little sound problem

I can't get the background music to keep playing when I put a sound in it.
Is it because the background music is a wav?
If so, how can I change it to a midi or something else so I can play both at the same time?
Sponsor
Sponsor
Sponsor
sponsor
gamer




PostPosted: Wed Jun 09, 2004 3:49 pm   Post subject: (No subject)

1. maybe u first post the codes see if we can help
2. i dun reli get ur situation, is it like, u hav a background music playing already (in fork), then u wanna play another sound on top of that bg music while its still on, rite??

if so the problem is that both music files must be of the same type (mp3,wav,midi), so u may wanna convert either one to mp3/wav (personally midi doesnt work for me), for the converting part, u'll need those sound editing softwares (i reli recommend goldwave, its reli good)
Tony




PostPosted: Wed Jun 09, 2004 4:56 pm   Post subject: (No subject)

actually its the other way around... you get 3 sound streams (one for each supported type) so if you want to play 2 sounds at the same time (background music and a sound effect) then they must be of different types...

I suggest mp3 background and wav effects
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
poomanchunk




PostPosted: Wed Jun 09, 2004 8:08 pm   Post subject: (No subject)

I was in a rush (had to go to work), so I didn't have much time to explain it any better.
But you get the idea.
I'll have to look for a sound editing software later though.
Thx for your help!
Cervantes




PostPosted: Wed Jun 09, 2004 8:22 pm   Post subject: (No subject)

a free mp3 to wav converter can be found here. the only problem is that it only allows you to convert 5 mp3s to wav and 5 wavs to mp3s. but depending on how many files you've got, it could be all you need
the_short1




PostPosted: Wed Jun 09, 2004 8:22 pm   Post subject: (No subject)

here is perfect FIX:





get ur background music into .mid format..
make sure u have the LATEST version of turing
get ur sound effects as .wav or .mp3




now... to start background musik


Music.PlayFileLoop ("background.mid")
then later to play sound effects


Music.PlayFileReturn ("soundeffect.wav")

*btw to stop background musik... Music.PlayFileStop


and when using music .playfile return... it WONT pause game to play sound!... its great!


hope that helps.... it helped me a ton when i had my PAcMan Game!!!

-Shorty
the_short1




PostPosted: Wed Jun 09, 2004 8:24 pm   Post subject: (No subject)

mid = notation (musical notes)
wav and mp3 = digital...


u only have 2 streams! or at least im pretty shure u do..


cuzi trie t oloop my .mp3 background musik... and when i played a .wav u cant hear the .wav...... so... yea
GB




PostPosted: Thu Jun 10, 2004 8:49 am   Post subject: (No subject)

code:

proc music
Music.PlayFile ("song.mp3")
end proc

fork music
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Jun 10, 2004 11:13 am   Post subject: (No subject)

GB : that's preaty useless... the_short1 has already posted a better way
Quote:

Music.PlayFileReturn ("soundeffect.wav")


(though I've got some suspesions for internal workings of that... Confused)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
the_short1




PostPosted: Thu Jun 10, 2004 2:41 pm   Post subject: (No subject)

Music.PlayFileReturn ("effect.mp3")

basically... it FORKS the playing of that file! so it dont interupt program!
so tony... yea i guess u can be sespcious..... since u dont like forks..... but turing forking this file internally is probaly FASTER and more eficient then the
fork proc way...


Music.PlayFileLoop ("bgrd.mid") will keep looping that file until Music.PlayFileStop is called


good for games....!
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 10 Posts ]
Jump to:   


Style:  
Search: