Csound Csound-dev Csound-tekno Search About

[Csnd] [OT] Advice request

Date2012-07-10 18:11
From"Art Hunkins"
Subject[Csnd] [OT] Advice request
My son Dave is doing some audio apps for the Android platform. I've very 
limited experience with audio formats and processing programs (as well as 
none with Android), and so can be of little help to him. I told him I'd 
forward his request to the Csound list (the only "relevent" list I subscribe 
to) to see if anyone here had experience he/she could share. What he's 
written is all I know about his project. I'll forward your responses.

TIA -
Art Hunkins
-----
Dave writes:

I am having some difficulty and wondering if you can help me. In my 
'distill' app I have four steps in my audio transformation from the phone to 
what the final web listener hears.

1. I'm recording in m4a which is mpeg-4 format with aac encoding native on 
the phone.

2. Then I'm transcoding to 16-bit PCM in WAV format for use on the server

3. I take the 16-bit PCM and perform some filtering on it while also 
trimming and fading the clips, before finally outputting mp3

4. Last I take the mp3 from the previous step and convert to ogg-vorbis

Two things are bothering me about the process I'm currently using:

First, the 16-bit PCM / WAV file is huge compared to all the others, and 
since it's in the middle I know I could save time by encoding, writing and 
subsequently reading and decoding a smaller intermediate file.

Second, the output at the end (the mp3 and ogg files, which are the ones 
heard by the web users) has lots of high-frequency artifacts in it.

Intuitively, I feel like down-sampling (or simply *not* upsampling the 
intermediate wav file) should solve that problem--however I'm not sure how 
to do it; just wanted to check with you to see if there is something 
rudimentary that I'm missing. (Plus, I don't really understand half of what 
I typed.)



Date2012-07-10 20:50
FromSteven Yi
SubjectRe: [Csnd] [OT] Advice request
Hi Art,

Just speculations here. It seems like there's a lot of transcoding
going on that could be skipped.  I'd imagine a more efficient way to
go about it would be to decode frame by frame and do processing of
just a frame at a time or perhaps set of frames, rather than going to
full WAV.  Also, the process could encode inline.  That'd get around
having to store the full WAV on disk or memory.  After that, encoding
to mp3 and then to ogg after that seems like it'd introduce the
artifacts; probably should go straight to ogg.  If he's trying to
release both mp3 and ogg, then I'd still recommend encoding both from
the WAV rather than encoding OGG from MP3.

Hope that's useful!
steven


On Tue, Jul 10, 2012 at 7:11 PM, Art Hunkins  wrote:
> My son Dave is doing some audio apps for the Android platform. I've very
> limited experience with audio formats and processing programs (as well as
> none with Android), and so can be of little help to him. I told him I'd
> forward his request to the Csound list (the only "relevent" list I subscribe
> to) to see if anyone here had experience he/she could share. What he's
> written is all I know about his project. I'll forward your responses.
>
> TIA -
> Art Hunkins
> -----
> Dave writes:
>
> I am having some difficulty and wondering if you can help me. In my
> 'distill' app I have four steps in my audio transformation from the phone to
> what the final web listener hears.
>
> 1. I'm recording in m4a which is mpeg-4 format with aac encoding native on
> the phone.
>
> 2. Then I'm transcoding to 16-bit PCM in WAV format for use on the server
>
> 3. I take the 16-bit PCM and perform some filtering on it while also
> trimming and fading the clips, before finally outputting mp3
>
> 4. Last I take the mp3 from the previous step and convert to ogg-vorbis
>
> Two things are bothering me about the process I'm currently using:
>
> First, the 16-bit PCM / WAV file is huge compared to all the others, and
> since it's in the middle I know I could save time by encoding, writing and
> subsequently reading and decoding a smaller intermediate file.
>
> Second, the output at the end (the mp3 and ogg files, which are the ones
> heard by the web users) has lots of high-frequency artifacts in it.
>
> Intuitively, I feel like down-sampling (or simply *not* upsampling the
> intermediate wav file) should solve that problem--however I'm not sure how
> to do it; just wanted to check with you to see if there is something
> rudimentary that I'm missing. (Plus, I don't really understand half of what
> I typed.)
>
>
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>

Date2012-07-10 22:44
FromJim Aikin
Subject[Csnd] Re: [OT] Advice request
I'm not an expert on programming audio apps, but I can offer a few general
comments.

As Steven notes, you absolutely don't want to convert directly from mp3 to
ogg. Create the ogg file directly from the 16-bit PCM.

If the mp3 has artifacts, try encoding at a higher bit rate. I never use
128kbps for synthesizer music, because it sounds like total crap. Try
320kbps.

If you're hearing artifacts when you encode the PCM down to a 320kbps mp3,
then there are two or three possibilities: Either your encoder isn't doing
its job properly (could be a bad encoder, could be wrong settings), or the
artifacts were there in the original aac file and are simply being magnified
because the mp3 and/or ogg encoder things they're an important part of the
signal. Or possibly the PCM is being encoded improperly.



--Jim Aikin

--
View this message in context: http://csound.1045644.n5.nabble.com/OT-Advice-request-tp5714132p5714146.html
Sent from the Csound - General mailing list archive at Nabble.com.