Source language: Translate to:

stopping and starting audio

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

stopping and starting audio

Postby BikerBen » Mon Nov 27, 2006 6:54 pm

I want to create a master page icon that can both stop and restart various audio files that are associated with different chapters of my ebook. (Each chapter has a distinct audio file set to start playing on the first page of the chapter.)

I can get the icon to stop all media. Is there any command that would force a general restart (without referring to individual audio files)? :?
User avatar
BikerBen
 
Posts: 10
Joined: Thu Apr 06, 2006 6:17 pm
Location: Indiana, USA

Postby Neosoft Support » Tue Nov 28, 2006 4:53 pm

There are probably several ways to accomplish something like this. The simplest might be to simply mute the volume instead of stopping and starting the sound. For example, to mute the sound use this:

SetVolume "Wave" "0"

To restart the sound, use this:

SetVolume "Wave" "255"

Another option would be to give your sound files the same name as the pages they belong to. For example:

Page 1.wav
Page 2.wav
Page 3.wav
etc.

Then you can restart the appropriate sound for the current page like this:

PlaySoundFile "[Embedded][PageTitle].wav" "Loop"

This option requires that you add your sound files to NeoBook's Embedded Files list.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby BikerBen » Tue Nov 28, 2006 5:28 pm

Thanks but not quite what I was looking for.

The audio files are just background music. The dafult will be to play the music starting with chapter 1. But if the user clicks the button to mute or stop audio, I want them, at any time within any subsequent chapter, to be able to click the same master page button to restart the audio. By the same token, I don't want to user to have to re-mute at each chapter.
User avatar
BikerBen
 
Posts: 10
Joined: Thu Apr 06, 2006 6:17 pm
Location: Indiana, USA

Postby BikerBen » Tue Nov 28, 2006 7:01 pm

Got this one figured out with a GetVolume and and IF statement. :)
User avatar
BikerBen
 
Posts: 10
Joined: Thu Apr 06, 2006 6:17 pm
Location: Indiana, USA

Postby Cipolla » Wed Nov 29, 2006 4:57 am

Hi BikerBen,

i am glad to see, that you could solve the problem. Just to make it complete, i made a similar application in the past.

The reason was, that i am listening to internet radio and my keyboard has no buttons to mute the sound or for volume up and down.

So i created this small handy taskbar tool with shortcuts to to this.
You will need the Keyboardhooker Plugin from Neosoft to use the pub.

Image

Take a look here (Zip file with source and exe)

http://www.empics24.de/neobook/muteit.zip

Tested only under windows 2000.
Greetings from Germany
Klaus
User avatar
Cipolla
 
Posts: 166
Joined: Fri Apr 01, 2005 1:45 am
Location: Germany

Postby BikerBen » Wed Nov 29, 2006 9:41 am

Klaus,

Cool. My hat's off to you once again.
User avatar
BikerBen
 
Posts: 10
Joined: Thu Apr 06, 2006 6:17 pm
Location: Indiana, USA


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 3 guests

cron