Thread: [Osalp-dev] Application Design Clarification
Status: Abandoned
Brought to you by:
daservis
|
From: Anthony Z. <zw...@us...> - 2001-08-20 17:50:43
|
Hello, I'm seeking a bit of clarification on how to use OSALP in my application. A brief background: My module will receive audio data in buffers, read from an HTTP source (though I am not responsible for the reading.) This data must then be converted to 8kHz AU-ULAW with the header stripped. What I was planning to do is build an audio device that requires 8khz AU-ULAW. It would then start by stripping off the header, and write the data out to a set of buffers. Other portions of the application will read those buffers and do the actual writing to the audio device through it's API. I thought that an aflibAudioMemoryInput class would do the trick, but as far as I can understand it, the data must already be in the "correct" format as noted in section 4.2.10 of the Audio Library Programmers Manual. It's not clear to me what is the "correct" format. My input data could be one of: Raw (headerless) 8kHz 8-bit mu-law [PCM] single channel* Raw (headerless) 8kHz 8-bit a-law [PCM] single channel* WAV (RIFF header) 8kHz 8-bit mu-law [PCM] single channel* WAV (RIFF header) 8kHz 8-bit a-law [PCM] single channel* Others we specify as supported(MP3, ...) The item's marked by an (*) are required. I need to convert these formats to 8kHz Raw (headerless) 8-bit mu-law [PCM] single channel, which is what our audio device understands. The input data format I was hoping for is all of the required items, plus additional formats as supported by OSALP (plus any additional we may want to create supporting our audio device.) In general, I know which of the input types I will be getting from the content-type in the header. The question is, after I recognize that the file is MP3, how do I put an MP3 decoder into the audio chain so that the device writer can get the correct input. If anything is not clear, let me know, and I'll try to explain better. Thanks, Anthony |
|
From: Darrick S. <da...@dc...> - 2001-08-20 21:55:07
|
My thoughts:
1. You'll get the audio data in buffers. So this means the file modules
will need to handle a stdin stream. I could very easily do this. Another
option is to setup the file modules to accept a data buffer and read from
that rather then opening a file.
2. Output is much more simple. You open a aflibAudioFile with the input as
parent after setting the config to what you want. You should be able to
choose what format you want too. Write it to /dev/null. Currently we don't
have a raw 8kHz ULAW format. The sox module can handle it but it's not
currently listed in the exported formats. I'll fix that.
so
aflibAudioFile* output = new aflibAudioFile( input, "8kHz U-LAW",
"/dev/null", config, status);
then:
aflibData* data;
while( no_samples){
data = output->process(status,-1,no_samples,FALSE);
do_something_with_data( data );
}
On Monday 20 August 2001 10:52, Anthony Zawacki wrote:
> Hello,
>
> I'm seeking a bit of clarification on how to use OSALP in my application.
>
> A brief background:
> My module will receive audio data in buffers, read from an HTTP source
> (though I am not responsible for the reading.) This data must then be
> converted to 8kHz AU-ULAW with the header stripped. What I was planning to
> do is build an audio device that requires 8khz AU-ULAW. It would then
> start by stripping off the header, and write the data out to a set of
> buffers. Other portions of the application will read those buffers and do
> the actual writing to the audio device through it's API. I thought that an
> aflibAudioMemoryInput class would do the trick, but as far as I can
> understand it, the data must already be in the "correct" format as noted in
> section 4.2.10 of the Audio Library Programmers Manual. It's not clear to
> me what is the "correct" format.
>
> My input data could be one of:
> Raw (headerless) 8kHz 8-bit mu-law [PCM] single channel*
> Raw (headerless) 8kHz 8-bit a-law [PCM] single channel*
> WAV (RIFF header) 8kHz 8-bit mu-law [PCM] single channel*
> WAV (RIFF header) 8kHz 8-bit a-law [PCM] single channel*
> Others we specify as supported(MP3, ...)
>
> The item's marked by an (*) are required. I need to convert these formats
> to 8kHz Raw (headerless) 8-bit mu-law [PCM] single channel, which is what
> our audio device understands. The input data format I was hoping for is
> all of the required items, plus additional formats as supported by OSALP
> (plus any additional we may want to create supporting our audio device.)
>
> In general, I know which of the input types I will be getting from the
> content-type in the header. The question is, after I recognize that the
> file is MP3, how do I put an MP3 decoder into the audio chain so that the
> device writer can get the correct input.
>
> If anything is not clear, let me know, and I'll try to explain better.
>
> Thanks,
> Anthony
>
>
> _______________________________________________
> Osalp-dev mailing list
> Osa...@li...
> http://lists.sourceforge.net/lists/listinfo/osalp-dev
|