Trying to use the perl SDL::* modules to play wav clips and I can't get a decent volume on the headphone o/p.
SDL::Mixer::Channels::volume( -1, 128 );
Does not make any difference although using less than 128 for the volume makes it even quieter.
use strict; use warnings; use SDL; use Carp; use SDL::Audio; use SDL::Mixer; use SDL::Mixer::Samples; use SDL::Mixer::Channels; SDL::init(SDL_INIT_AUDIO); unless( SDL::Mixer::open_audio( 44100, AUDIO_S16SYS, 2, 4096 ) == 0 ){ Carp::croak "Can't open audio: ".SDL::get_error();} my $sample = SDL::Mixer::Samples::load_WAV('wm_tell.wav'); unless($sample){ Carp::croak "Can't load wav file: ".SDL::get_error();} SDL::Mixer::Channels::volume( -1, 128 ); my $playing_channel = SDL::Mixer::Channels::play_channel( -1, $sample,0 ); sleep(3); SDL::Mixer::close_audio();
TIA