Re: Trimming approach
Re: Trimming approach
- Subject: Re: Trimming approach
- From: James Chandler Jr <email@hidden>
- Date: Tue, 31 Mar 2009 13:20:19 -0400
Hi Santosh
I don't know if you mean copying packets from a compressed audio file
(such as MP3 or M4a) or if you mean copying packets from an
uncompressed file (such as WAV or AIF).
If you mean un-compressed data, one tweak would be to fade the ends
where you cut out material. Unless you know that you are cutting in a
very silent part of the source file, you will hear clicks in the audio
at the splice points. Some clicks will be louder than other splice
clicks, just depending on the random mis-match of the spliced waveforms.
Something as simple as a 10 ms linear fade or crossfade is sufficient
to eliminate the majority of splicing clicks.
If you mean compressed audio data, then simply copying on the packet
level MAY work fine, but as with uncompressed audio you may hear
clicks or other oddities at the splice points. The behavior MAY depend
on characteristics in the file player program. One player might handle
the discontiguity better than another player.
I don't know if all compressed audio is 'streamable'. Many folks on
this list can tell you more. I know that MP3 is 'streamable' and each
packet contains sufficient format info for an MP3 decompressor to re-
sync and begin to decompress at any packet boundary. With MP3, I think
you could randomly hack out pieces of a file IGNORING packet
boundaries, and many players could still play the stream. There is no
guarantee that the splice point would sound pretty, though. It might
be very ugly in some players <g>.
Hopefully someone who knows better can respond. If I had to trim
compressed audio files, and wanted to do the job quick without turning
it into a science project, I would decompress the audio, trim with
fades, and then re-compress the audio. That has problems because you
lose a little fidelity thataway.
So maybe there is a wonderful way to make clickless splices without
decompressing the audio. Dunno.
James Chandler Jr.
On Mar 31, 2009, at 7:30 AM, Santosh Kumar wrote:
Hello Everyone ,
Currently i have implemented trimming feature for audio file in my
application. In my approach i am reading the entire file packet by
packet and writing the packets to other file by skipping the packets
in selected range.So , i get a file with packets removed in selected
range.
Is my approach for trimming is correct or is there any other
optimized way to do this.
Thanks is advance.
Regards,
Santosh Kumar
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden