Re: About how many channels of 16/44.1 PCM audio should I be able to stream from disk on an iPhone 4?
Re: About how many channels of 16/44.1 PCM audio should I be able to stream from disk on an iPhone 4?
- Subject: Re: About how many channels of 16/44.1 PCM audio should I be able to stream from disk on an iPhone 4?
- From: Barry Duggan <email@hidden>
- Date: Tue, 08 May 2012 17:48:20 +0100
If you want it to "just work" id say go and use the fileplayer audiounit.
If you want to get you hands more dirty implement your own on demand sample fetching and buffer filling (producer / consumer).
Fileplayer audiounit seems to totally take care of setting in memory buffers and sequencing the reading of files in time and efficiently.
I think the bottleneck might have less to do with the size of the files and more to do with how many simultaneous reads from disk you are trying to do. The fileplayer handles this nicely. It wont try to overburden the disk. If a file has to wait a very long time for its next buffer to be read the unit seems to gracefully resize audio buffers accordingly.
Agreed that benchmarking and testing disk read speeds could be quite an involved exercise so dont be to concerned about bottlenecks until you actually have a problem, which if you use file player unit, you probably wont (based on my experience of 20 mp3's).
Disclaimer : My analysis of how the fileplayer unit works internally is purely an educated guess based on extensive use of it....
But, I can say for sure that it deffinately works great for mixing/playing multiple audio files.
On 8 May 2012 17:30, Morgan Packard
<email@hidden> wrote:
Thanks Barry.I'm curious how narrow the hard drive bottleneck actually is. Mp3s involve less data, so the hard drive will be much less of a bottleneck. I've never had to deal with hard drive speeds and don't even know how to look such a thing up.
-MorganOn Tue, May 8, 2012 at 12:19 PM, Barry Duggan
<email@hidden> wrote:
I'm personally using mp3 but uncompressed formats are perfectly fine provided you set the asbd correctly.Here is one that I've often used for stereo wav files
AudioStreamBasicDescription destinationformat={0};
destinationformat.mSampleRate=DEFAULT_SAMPLE_RATE;
destinationformat.mFormatID =kAudioFormatLinearPCM;
destinationformat.mFormatFlags=kAudioFormatFlagsNativeEndian|kAudioFormatFlagIsSignedInteger|kAudioFormatFlagIsPacked;
destinationformat.mBytesPerPacket=4;
destinationformat.mFramesPerPacket=1;
destinationformat.mBytesPerFrame=4;
destinationformat.mChannelsPerFrame=2;
destinationformat.mBitsPerChannel=16;
On 8 May 2012 13:40, Morgan Packard
<email@hidden> wrote:
Thanks for the anecdote Barry. Exactly the sort of info I was looking for. Can you confirm that you're using uncompressed files?
-Morgan
On Tue, May 8, 2012 at 4:20 AM, Barry Duggan
<email@hidden> wrote:
Have you considered using several aufileplayer units (ios 5) and a mixer unit?
I'm successfully mixing 20 stereo files at the moment with no performance issues.
Also, if you can't use ios 5 for what ever reason you could ExtAudioFileRead to read frm disk into memory in chunks like you do now. Again I've been able to read a lot of files from disks this way without any performance issues.
Prehaps you're incurring some overheads from using non apple libraries for whatever reason ?
On 7 May 2012 20:00,
<email@hidden> wrote:
Send Coreaudio-api mailing list submissions to
email@hidden
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.apple.com/mailman/listinfo/coreaudio-api
or, via email, send a message with subject or body 'help' to
email@hidden
You can reach the person managing the list at
email@hidden
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Coreaudio-api digest..."
Today's Topics:
1. About how many channels of 16/44.1 PCM audio should I be able
to stream from disk on an iPhone 4? (Morgan Packard)
----------------------------------------------------------------------
Message: 1
Date: Sun, 06 May 2012 17:09:19 -0400
From: Morgan Packard <email@hidden>
To: email@hidden
Subject: About how many channels of 16/44.1 PCM audio should I be able
to stream from disk on an iPhone 4?
Message-ID:
<CALG5StJak=B_scZ33EhKxuYHU2sqjn6+9dJo3mu3a7=email@hidden>
Content-Type: text/plain; charset="iso-8859-1"
Most of my audio code is built on top of the
STK<https://ccrma.stanford.edu/software/stk/> library.
I'm using STK's FileRead class to load audio from disk (which in turn uses
fopen to read the files).
I want to be able to play long files (too long to fit in memory), so I'm
loading them a bit at a time from disk before mixing them and sending them
out via the remoteIO callback.
The code I'm currently running is pretty solid streaming three stereo files
from disk, but begins to get glitchy as I start to add files above that.
I'd be grateful for a rough ballpark of how many stereo files I should be
able to play back simultaneously.
Questions:
- Am I indeed going to be limited by disk speed to a fairly low number of
files?
- Is disc speed enough of a bottleneck so that using compressed files might
give me a higher number of parallel playbacks?
- Is there something inherently slow or unreliable or inappropriate for
streaming audio from disk about fopen?
thanks,
-Morgan
--
===============
Morgan Packard
cell: (720) 891-0122
aim: mpackardatwork
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.apple.com/mailman/private/coreaudio-api/attachments/20120506/768e6a35/attachment.html>
------------------------------
_______________________________________________
Coreaudio-api mailing list
email@hidden
https://lists.apple.com/mailman/listinfo/coreaudio-api
End of Coreaudio-api Digest, Vol 9, Issue 128
*********************************************
_______________________________________________
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
--
===============
Morgan Packard
aim: mpackardatwork
--
===============
Morgan Packard
aim: mpackardatwork
_______________________________________________
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