htmlVideoLoader & pgSoundLoader Volume levels

Help for using specific functions

htmlVideoLoader & pgSoundLoader Volume levels

Postby Kataleena » Wed Feb 25, 2015 6:57 pm

I'm using both htmlVideoLoader & pgSoundLoader in my project. In the documentation it says htmlVideoLoader default volume is 75 and pgSoundLoader default volume is 50.

Is that a percentage of the audio playing?

If my audio and video files have the same audio level does that they wont match if I don't enter a volume level?

Thanks
Kat
Kataleena
 
Posts: 49
Joined: Sun Feb 23, 2014 10:05 pm

Re: htmlVideoLoader & pgSoundLoader Volume levels

Postby Clifton » Wed Feb 25, 2015 11:42 pm

If you set audio to 50 (or 50%), this is relative to the amplitude of the media and to the output of the hardware of the computer. Some media will be too soft at 50 because the audio itself has a low amplitude. Other audio files have a greater amplitude and 50 may actually be too high a volume, especially if the computer hardware is more powerful to begin with. Usually, you should manipulate the amplitude of your audio (or audio/video) files so they play at expected sound levels relative to the human ear. Some sound editors allow you to normalize the amplitude or waveform of the audio to an average which generally makes them all sound pretty similar at the save volume levels. If you can't edit the audio files, then you will have to experiment with the best volume settings when loading them with htmlVideoLoader() or pgSoundLoader().
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: htmlVideoLoader & pgSoundLoader Volume levels

Postby Kataleena » Thu Feb 26, 2015 2:17 am

My audio and video files have been worked on to output on a computer correctly, I'm happy with the levels.

I guess I'm asking what do I need to set the volume value to, so both the audio and video output at my original level?

Can I ask why you have the defaults for htmlVideoLoader and pgSoundLoadeset set to different values?

Just on a side note, and I'm probably dreaming but I have used htmlVideoLoader() and pgSoundLoader() over 100 times in one program alone, is there any way I can change the value without having to find them all and change individually?
Kataleena
 
Posts: 49
Joined: Sun Feb 23, 2014 10:05 pm

Re: htmlVideoLoader & pgSoundLoader Volume levels

Postby Clifton » Thu Feb 26, 2015 3:36 am

audio only files tend to have higher amplitudes and seem to be better with lower initial defaults. Videos tend to have lower audio amplitudes and I've found they benefit from higher initial values.

Instead of setting volume by manually inputting a value ...
volume = 75
set a global variable called mediaVolume and set it to your preferred value.
Then ... in the PowerPac functions:
volume = mediaVolume
If you later need to change the volume, just change the value of mediaVolume and the functions will use whatever its value is at the time they are executed.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: htmlVideoLoader & pgSoundLoader Volume levels

Postby Clifton » Fri Feb 27, 2015 7:51 am

Just thinking about this further, I noticed you said you have some 100 implementations of htmlVideoLoader() in your application. Since all parameters of PowerPac functions can be set via variables, why not just have one or two implementations of the function and dynamically set the parameters based on the needs of a particular page. This would probably reduce the time to do an export and simplify the overall application in general. It also makes it easier to fix something when it appears to be broken.

I do this a lot with the PowerPac Help API.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am


Return to Function Help

Who is online

Users browsing this forum: No registered users and 2 guests

cron