PlayCDTrack Not Working

BlitzPlus Forums/BlitzPlus Programming/PlayCDTrack Not Working

MattVonFat(Posted 2004) [#1]
Hi, the PlayCDTrack command doesn't work on my computer. It is an accepted command as it doesn't provide an error, it just doesnt produce any sound. When i had Blitz Basic the command worked fine but now there is some problem. Can anyone help?


Tiger(Posted 2004) [#2]
Maybe your Cd-rom is not connected to the soundcard??


MattVonFat(Posted 2004) [#3]
im not very good when it comes to hardware like sound cards but i can play CDs through windows media player and it used to work with Blitz Basic. If the sound card connection could still be the problem sorry for bring this up!


Tiger(Posted 2004) [#4]
If you can play cd's with other player's, the cabel must be connected.
I don't know really what the problem can be, can you show some code for us and maybe we can see the problem.

Bye, and good luck.


MattVonFat(Posted 2004) [#5]
; PlayCDTrack example

; Get a track to play from user
track=Input$("Enter a CD track number to play:")

; Play the track, assign a channel - just play once
chnCD=PlayCDTrack(track,1)

; Figure out what time it is now
oldTime=MilliSecs()
; Play until the channel is over or ESC
While ChannelPlaying(chnCD) And (Not KeyHit(1))
; clear and print the time elapsed
Cls
Print "Time Elapsed (sec):" + ((MilliSecs()-oldTime)/1000)
Wend

; Stop the channel
StopChannel chnCD

That is the code i have been using, its just the sample out of the commands section, with out the locate though as that doesnt work for Blitz +. It just stops once you select a track.