Author |
Topic: Fading gently away (Read 1442 times) |
|
Ken Down
Guest
|
 |
Fading gently away
« Thread started on: Jun 14th, 2013, 11:45am » |
|
Using the code below, which I got from the Wiki, (http://bb4w.wikispaces.com/Playing+a+media+file+using+Direct+Show) I can make my program play mp3 and mpg files (audio and video). I have also programme a hot key so that I can instantly stop playback of either.
SYS!(!m_mediaControl%+44),m_mediaControl%,FNwide(soundfile$),0TOhr% SYS!(!m_mediaControl%+28),m_mediaControl%TOhr%
However stopping music in the middle is always abrupt and I would love a way of gently fading the music to nothing before stopping it.
Any help appreciated.
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Fading gently away
« Reply #1 on: Jun 14th, 2013, 12:56pm » |
|
on Jun 14th, 2013, 11:45am, Guest-Ken Down wrote:However stopping music in the middle is always abrupt and I would love a way of gently fading the music to nothing before stopping it. |
|
I assume you've already tried the method given in the main Help documentation (SYS "waveOutSetVolume"):
http://www.bbcbasic.co.uk/bbcwin/manual/bbcwine.html#playsound
If that doesn't work, presumably it's because the wrong 'volume control' is being manipulated. In that case open up your audio mixer (usually by double-clicking on the loudspeaker icon in the systray) and see what control it gives you over the MP3 volume. Assuming you can change it, use the code in this Wiki article to do it in your program:
http://bb4w.wikispaces.com/Controlling+the+audio+mixer
Richard.
|
« Last Edit: Jun 14th, 2013, 2:58pm by admin » |
Logged
|
|
|
|
Ken Down
Guest
|
 |
Re: Fading gently away
« Reply #2 on: Jun 28th, 2013, 6:49pm » |
|
Thanks. I finally got round to trying your suggestions out. The second one didn't work - possibly because of my sound card - but the first one did, though playing an mp4 file the sound faded but subsequent attempts to play the file resulted in it sort of stuttering! I had to restart the program. Curious.
No problem with mp3s, however.
Many thanks again.
|
|
Logged
|
|
|
|
Ken Down
Guest
|
 |
Re: Fading gently away
« Reply #3 on: Jun 29th, 2013, 06:14am » |
|
Hmmm. Subsequent investigation shows that it is just one particular mp4 file which stutters if an attempt to restart it is made. It was created using a different - more modern! - program, so presumably there is a problem with the codec rather than BB4W.
Now all I need is a way to simultaneously fade the video to black!
|
|
Logged
|
|
|
|
|