BBC BASIC for Windows
« Fading gently away »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 9:56pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Fading gently away  (Read 1442 times)
Ken Down
Guest
xx 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.
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx 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 » User IP Logged

Ken Down
Guest
xx 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.
User IP Logged

Ken Down
Guest
xx 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!
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls