• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Advice on encoding possibilities
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Advice on encoding possibilities


  • Subject: Advice on encoding possibilities
  • From: "Zuhayr Khan" <email@hidden>
  • Date: Sat, 24 Apr 2004 06:36:17 +0000

Hi,

I want to write an application that takes an MP3 file and splits in into multiple MP3 files whenever there's a gap of silence in the audio.

I want to use CoreAudio to do this, but in my first few bits of exploratory programming I'm finding some issues. I'm not sure if it's that I'm not hitting the API correctly, or that there are limitations.

The way I'm anticipating this program working is:

* build an AUGraph
* hook up input file with an MP3->LPCM AudioConverter
* hook up and create first MP3 output file
* read in chunks of the MP3 file and convert them to LPCM
* have an AudioUnit that senses the gaps in the LPCM and returns fake EOF
* have the output file flushed and closed off and a new one created
* repeat for the remainder of the MP3

The first problem I'm getting is while I can get AudioFile to create me a nice new MP3 file, I can't get/configure an AudioConverter to convert from LPCM to MP3. I'm guessing this is because there isn't a Codec in the system that will do LPCM->MP3.

I'm not wedded to the idea of doing the gap detection against LPCM - but I'm assuming this is the way to do that kind of thing - obviously if there's some cleverness that means I don't have to convert, then so much the better.

Listing my available Audio Components, I saw there was an LPCM->AAC so I thought I'd give that a try (I figured that maybe it being an MP4 format it might then allow me to do an MP3 to MP4 somehow else) - however, while I can get a AudioConverter for LPCM->AAC, AudioFile won't create me a file - I think this is possibly a red herring, but thought I'd mention it.

I think I've understood from the CoreAudio docs and other sources that an AudioConverter effectively wraps a Codec - am I right? And if so; if there isn't an LPCM->MP3 facility available right now should I be looking to write or get hold of a LPCM->MP3 Codec?

I think in other postings I've heard suggestion that some conversions are not supported right now; is there a schedule for other Codecs?

I think the only other question I have is about Multi-Threading. Looking though some of the CoreAudio example code I see quite a bit of Multi-Threading especially in PlayAudioFile and DiskWriterAUGraph. I understand the need for these apps to be multi-threaded, but wanted to understand in general the idea behind having multi-threaded code in CoreAudio-based apps.

As my application is very much an offline processing application, do I need to go with the multi-threaded way of working, or should I be able to do my processing all in one thread? (I don't mind writing Multi-Threaded code and I see that CoreAudio has nice support for it - but I just want to understand whether it's a necessity of the API or just of certain apps).

Sorry it's such a big bundle of questions, any help on this from anybody would be very much appreciated.

Thanks in advance,

Zuhayr

--

Zuhayr Khan

_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Advice on encoding possibilities
      • From: William Stewart <email@hidden>
  • Prev by Date: Re: Newbie Question about AudioConverter
  • Next by Date: AC3 decoding
  • Previous by thread: Re: Newbie Question about AudioConverter
  • Next by thread: Re: Advice on encoding possibilities
  • Index(es):
    • Date
    • Thread