File: programming/cocoa/UKSoundUKSystemSound.zip/UKSound.m


//
//  UKSound.m
//  MobileMoose
//
//  Created by Uli Kusterer on 14.07.08.
//  Copyright 2008 The Void Software. All rights reserved.
//
 
#import "UKSound.h"
"Couldn't open AudioFile.""Couldn't determine audio file format.""Couldn't create new output for queue.");
 
		// We have a couple of things to take care of now
		// (1) Setting up the conditions around VBR or a CBR format - affects how we will read from the file
		// if format is VBR we need to use a packet table.
// first check to see what the max size of a packet is - if it is bigger
			// than our allocation default size, that needs to become larger
"Couldn't get max packet size of audio file."// we also need packet descpriptions for the file reading
// (2) If the file has a cookie, we should get it and set it on the AQ
"Couldn't get magic cookie of audio file.""Couldn't transfer magic cookie of audio file to qudio queue.""Couldn't register for playback state changes.");
		
			// prime the queue with some data before starting
"Couldn't allocate buffer %d.""Couldn't start audio queue.""Couldn't get play state of queue."// Read nPackets worth of data into buffer
"Couldn't read into buffer."// Queues the buffer for audio input/output.
"Couldn't enqueue buffer."// I should be calling the following, but it always makes the app hang.
"Couldn't stop queue.");
				// reading nPackets == 0 is our EOF condition
 

This code uses the PclZip Zip File reading code, which is subject to the GNU LGPL. It also uses the GeSHi syntax highlighter, subject to the GPL. Ask if you want this for your own web site, it's free.