www.libsdl.org sdl.perl.org documentation
Second, here's a little bundle to make sure that you have all the requirementsMake sure you have the latest version, then try this script from sdl.perl:#!/usr/bin/perl use strict; use warnings; use CPAN; CPAN::Shell->force('install', "PadWalker", "Data::Dumper::Names", "Filter::Util::Call", "ExtUtils::MakeMaker", "ExtUtils::CBuilder", "File::Spec", "Scalar::Util", "Test::Harness", "Pod::Man", "Pod::Simple", "Pod::Escapes", "Pod::Usage", "HTML::Entities", "Net::SMTP", "Net::SMTP_auth", "Test::Pod", "Test::Pod::Coverage", "Text::Trac", "Getopt::Long", "Text::Wrap", "Test", "YAML", "ExtUtils::CBuilder", "Test::Simple", "IO::CaptureOutput", "Test::Most", "Pod::ToDemo", "File::Temp", "File::ShareDir", "File::Path", "File::Fetch", "Digest::SHA", "Archive::Extract", "Archive::Tar", "Archive::Zip", "Module::Build", "Alien::SDL");
#!/usr/bin/perl use strict; use warnings; use SDL; use SDL::Audio; use SDL::AudioSpec; SDL::init(SDL_INIT_AUDIO); # Converting some WAV data to hardware format my $desired = SDL::AudioSpec->new(); my $obtained = SDL::AudioSpec->new(); # Set desired format $desired->freq(22050); $desired->channels(1); $desired->format(AUDIO_S16); $desired->samples(8192); # Open the audio device if( SDL::Audio::open($desired, $obtained) < 0 ) { printf( STDERR "Couldn't open audio: %s\n", SDL::get_error() ); exit(-1); } # Load the test.wav my $wav_ref = SDL::Audio::load_wav('../../test/data/sample.wav', $obta +ined); unless( $wav_ref ) { warn( "Could not open sample.wav: %s\n", SDL::get_error() ); SDL::Audio::close_audio(); SDL::quit; exit(-1); } my ( $wav_spec, $wav_buf, $wav_len ) = @{$wav_ref};
In reply to Re: Script with audio files
by Khen1950fx
in thread Script with audio files
by victor_charlie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |