[asterisk-dev] adjusting the playback speed of voicemail messages.

Johan Wilfer johan at wilfer.se
Thu Apr 3 04:45:46 CDT 2008


ControlPlayback returns the position the playback stopped.
And also lets you define different stop keys. It also returns the 
key that stopped the playback in a channel variable so you can
have your own dialplan logic here.

This application plays nice with sox. Maybe something similar could be
done to the voicemail application...

/Johan

ons 2008-04-02 klockan 16:33 -0500 skrev Steven S. Critchfield:
> ----- "Travis Hein" <travis.hein at travnet.org> wrote:
> > I’m hoping I’m missing something and there is some easy way, but
> > after
> > looking at the code, it appears that the sample rate for the ast_frame
> > is
> > assumed to be 8 kHz. The formats/format_wav.c seems to also assume 8
> > kHz
> > always as well, and the ast_format does not seem to have an
> >  int (*set_sample_rate)(struct ast_filestream *, int new_rate);
> > either, which I was thinking would need something like that so that
> > the
> > ast_control_streamfile() (that is called by the voicemail playback)
> > could
> > adjust the sample rate by a given amount, just like it currently does
> > for
> > the skipms value to the seek() function.
> 
> The problem with speed up and slow down is that just adjusting the sample rate doesn't make inteligent sounding audio. I'm sure you are familiar with the sound of audio from a tape recorder when you also hit the fast forward button. Sounds a lot like chipmunks. 
> 
> Also the sample rates are set specifically because that is what it takes to get it onto PSTN networks. I believe there is another branch where they have worked on that assumption, but it isn't the trunk from what I know.
> 
> What you need to be able to do is essentially set up either a filter or a temporary file. A filter would sit in the middle of the audio stream and apply some tricks to properly stretch or compress the audio in such a way as to not affect pitch. The temp file route would be to use sox to modify the audio file and maintain the sample rate and such so you could just work from the modified audio file.
> 
> Downside is, I don't think putting a audio filter in the loop is currently feasible in the trunk, again, other branches I believe are working on this. I don't know how easy the sox route would be for you. Especially if you expect to maintain a pointer into the audio file and only effectively adjust from that spot forward. or restart from the sport you stopped to modify the audio file.
> -- 
> Steven Critchfield critch at basesys.com
> 
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
> 
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev




More information about the asterisk-dev mailing list