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

Username:   Password: 
 RegisterRegister   
 Sound troubles with Music.PlayFile
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Jonny Tight Lips




PostPosted: Wed Oct 13, 2004 7:22 pm   Post subject: Sound troubles with Music.PlayFile

My code
code:
loop
Music.PlayFile ("sworddraw.wav")
end loop

The code seems right to me but when I use it no sounds comes out. There are no errors. I'm thinking that there might be something wrong with the actual sound file so I shal attach it for you all to look at. Hope you can help me. thx
EDIT: Or maybe I won't attch it since compsci doesn't seem to allow you to attach music files. Might I sujest someone (mod/admin) make it so you can. thank you
Sponsor
Sponsor
Sponsor
sponsor
Cervantes




PostPosted: Wed Oct 13, 2004 7:27 pm   Post subject: (No subject)

When using Music.PlayFile, do not use it in a loop. I believe that that code would start the song and then restart it each time through the loop. So you wouldn't hear anything, most likely, because there is no sound in the first thousanth of a second in that file.
Otherwise, for that to actually play the file sworddraw.wav has to be in the same directory as your turing program. If it is in a parent directory you can use .. if it is in a different directory all together you can write out the whole path.
Jonny Tight Lips




PostPosted: Wed Oct 13, 2004 7:29 pm   Post subject: (No subject)

Nope, and nope. I have it in the same directory and I took off the loops and still nothing.
Dan




PostPosted: Wed Oct 13, 2004 8:51 pm   Post subject: (No subject)

Might I sujest that you learn how to use a ziping progame so you do not use up all my bandwith and space Snooty
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Cervantes




PostPosted: Thu Oct 14, 2004 3:38 pm   Post subject: (No subject)

I suggest you open a new turing window and just type in
code:
Music.PlayFile ("sworddraw.wav")

and see if it works. that way, you know if its that specific line or something with your program (that prevents that line from being executed).

in your program, use processes now for playing sound.
Jonny Tight Lips




PostPosted: Thu Oct 14, 2004 5:35 pm   Post subject: (No subject)

Still won't let me post the file. And I did zip it but nothing happens when I hit add attchment just refreshs the page and nothing diffent happens.
And all I have in my program is the Music.PlayFile ("sworddraw.wav") and it still doesn't work.
Cervantes




PostPosted: Thu Oct 14, 2004 6:00 pm   Post subject: (No subject)

then it's your file. have you tried playing it in some other program? (like windows media player or winamp?)
and dan purposefully doesn't allow .wav files to be uploaded. think about it, they are huge Confused
Paul




PostPosted: Thu Oct 14, 2004 6:07 pm   Post subject: (No subject)

I use Music.PlayFileLoop
and
Music.PlayFileStop
Sponsor
Sponsor
Sponsor
sponsor
Jonny Tight Lips




PostPosted: Thu Oct 14, 2004 6:42 pm   Post subject: (No subject)

Yah there was something wrong with my sound file so I jsut got another one.
Now I have another question. How do I stop the music from playing I've tryed
code:
        Music.PlayFile ("woo.mp3")
        Music.PlayFileStop

and
code:
        Music.PlayFile ("woo.mp3")
        Music.SoundOff


but nethor of them worked. So how do I stop it?[/code]
Jonny Tight Lips




PostPosted: Fri Oct 15, 2004 4:17 pm   Post subject: (No subject)

lil help would be appreicated
Cervantes




PostPosted: Fri Oct 15, 2004 4:47 pm   Post subject: (No subject)

The Turing Reference wrote:

var finished : boolean := false

% Loop playing background music until 'finished' is true.
process BackgroundMusic
loop
exit when finished
Music.PlayFile ("background.mid")
end loop
end BackgroundMusic

fork BackgroundMusic % Start the background music
Time.Delay (30000) % Wait for 30 seconds

% Stop the background music.
finished := true % The flag must be set first
Music.PlayFileStop % Music.PlayFile will return immediately
Jonny Tight Lips




PostPosted: Sat Oct 16, 2004 1:35 pm   Post subject: (No subject)

Ohh I get it. Thanks for the help Very Happy
boredstudent3




PostPosted: Sun Oct 24, 2004 12:05 am   Post subject: (No subject)

turing doesn't play mp3's does it?...

if not then i'm sure it will play wav files,,can anybody direct me w/ a link to a good mp3 to wav converter?...thanks folks!...=)
Tony




PostPosted: Sun Oct 24, 2004 12:07 am   Post subject: (No subject)

turing plays mp3 files
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
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  [ 14 Posts ]
Jump to:   


Style:  
Search: