Hello, using a tutorial from Perl-gtk2 website, written by Ross McFarland -- basically the project is an alarm clock with a gui. At count 5 seconds it plays a .wav file, at 10 seconds another .wav. All the while we update text on a label showing the seconds counting up.
I get audio artifacts using SOX. WAVfile2 is faintly playing in the background of WAVfile1.
I changed over to use SDL v2.2.6; Because of SDL::Mixer I get much better audio fidelity. Much better. However, I have no synchronization. wav1.wav and then wav2.wav plays immediately as if one, single audio file. The code continues, then invokes the call for wav2 and it does play, but not on cue, Playback repeats for wav2 and is arbitrary, meaning any time before the 10-seconds test-condition.
I would post a code snippet, but current code is five files if we include the Glade<xml>, the .wav's, and the code.
Opinions wanted:
- Do I que functions in a thread list?
- Do I make Perl Modules to 'encapsulate' the audio files?
- I can't seem to preload the audio data, or can I?
- Is SDL:: trying to be a framework, much like java Swing, and I need to do all GUI, all audio, all functionality from that module?
Thanks, really, if you can give me insight. Sound functionality is the step-child of coders. I like exploring the audio capabilities when I begin a new language.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.