Forward and return.

BlitzPlus Forums/BlitzPlus Beginners Area/Forward and return.

josé marcos(Posted 2015) [#1]
Hello again!

I need a code that causes a pointer to navigate through an audio. (MP3, WAV, or both)

I downloaded a code to try to understand the operation:
"Length of mp3"
http://www.blitzbasic.com/codearcs/codearcs.php?code=1775
Still no success!

I tried to break the head with something precarious like this:

;----------

Graphics 800, 600, 0, 2

a$=RequestFile("música", "mp3", 0)
m=LoadSound(a$)
p=PlaySound(m)
tempo=0
While Not KeyHit(1)

If KeyHit(57)
StopChannel(p):p=PlaySound(m)
tempo=0
EndIf
If KeyHit(205)
ChannelVolume(p, 0)
ChannelPitch(p, 4400000)
Delay 50
tempo=tempo+60
ChannelVolume(p, 1)
ChannelPitch(p, 44000)
EndIf

If KeyHit(203)
;StopChannel(p): p=PlaySound(m)
;ChannelVolume(p, 0)
;ChannelPitch(p, ?)
;Delay ?
;tempo=tempo-?
;ChannelVolume(p,1)
;ChannelPitch(p, 44000)
EndIf

Flip
Delay 1
tempo=tempo+1
Wend
End

;----------
By clicking on the audio, "time" counter initializes to mark (or try), the milliseconds elapsed.
Pressing space starts the audio with "tempo" 0.
Right arrow moves a while.
I would have left, he came back a few seconds.

Has anyone created something? or know how I could do this?
grateful now.

Sorry for the English, but was translated from Portuguese by google translator!


Matty(Posted 2015) [#2]
With wav it's not too hard. Mp3 can be more complex because the bit rate can change.

However it's not an area I'm all that familiar with so I can't offer much more than that sorry.