Playing & Recording Audio Audio Queue Services Playback - AQPlayer Class

Size: px
Start display at page:

Download "Playing & Recording Audio Audio Queue Services Playback - AQPlayer Class"

Transcription

1 Playing & Recording Audio Audio Queue Services Playback - AQPlayer Class iphone Application Index 1. AQPlayer 2. SpeakHere Classes & Resources 3. SpeakHere Class 4. AQPlayer Class 5. AQPlayer.h 6. Ready for Playback Flow 7. Start Playback Flow 8. Stop Playback Flow

2 iphone Application AQPlayer Sound Playback SpeakHere iphone Application Classes & Resources AQPlayer :

3 SpeakHere avtouch Application SpeakHereAppDelegate AQRecorder SpeakHereController SpeakHereViewController AQPlayer... AQPlayer,,! AQRecorder avtouch Classes Class & Resources AQPlayer 9 SetupNewQueue StartQueue AQBufferCallback isrunningproc DisposeQueue CreateQueueForFile CalculateBytesForTime StopQueue

4 avtouch AQRecorder.h Classes & Resources AQPlayer 1. public &! AQPlayer(! ~AQPlayer(! OSStatus!!!!!! StartQueue(BOOL inresume! OSStatus!!!!!! StopQueue(!!! OSStatus!!!!!! PauseQueue(!!! AudioQueueRef!!!! Queue()!!!! { return mqueue; }! CAStreamBasicDescription!! DataFormat() const!! { return mdataformat; }!!! Boolean!!!!!! IsRunning()!const!! { return (misrunning)? true : false; }! Boolean!!!!!! IsInitialized()! const! { return misinitialized; }!!! CFStringRef!!!!!! GetFilePath() const!! { return (mfilepath)? mfilepath : CFSTR("" }! Boolean!!!!!! IsLooping() const!! { return mislooping; }!!! void SetLooping(Boolean inislooping)!{ mislooping = inislooping; }! void CreateQueueForFile(CFStringRef infilepath! void DisposeQueue(Boolean indisposefile! 2. private &! UInt32!!! GetNumPacketsToRead()!!!! { return mnumpacketstoread; }! SInt64!!! GetCurrentPacket()!!!! { return mcurrentpacket; }! AudioFileID!! GetAudioFileID()!!!!! { return maudiofile; }! void!!! SetCurrentPacket(SInt64 inpacket)! { mcurrentpacket = inpacket; }!!! void!!! SetupNewQueue(!!! AudioQueueRef! mqueue;! AudioQueueBufferRef!mBuffers[kNumberBuffers];! AudioFileID!! maudiofile;! CFStringRef!! mfilepath;! CAStreamBasicDescription!! mdataformat;! Boolean!! misinitialized;! UInt32!!! mnumpacketstoread;! SInt64!!! mcurrentpacket;! UInt32!!! misrunning;! Boolean!! misdone;! Boolean!! mislooping; static void isrunningproc( void * inuserdata,!!!! AudioQueueRef inaq,!!!! AudioQueuePropertyID inid static void AQBufferCallback(!void *!! inuserdata,!!!!! AudioQueueRef!!! inaq,!!!!! AudioQueueBufferRef!! incompleteaqbuffer void CalculateBytesForTime( CAStreamBasicDescription & indesc,!!!! UInt32 inmaxpacketsize,!!!! Float64 inseconds,!!!! UInt32 *outbuffersize,!!!! UInt32 *outnumpackets! Ready for Playback Flow

5 1. avtouch Queue Classes &( ) Resources 1. AQPlayer - main() misrunning=false AQPlayer - AQPlayer::AQPlayer AQPlayer::AQPlayer() :! mqueue(0),! maudiofile(0),! mfilepath(null),! misrunning(false),! misinitialized(false),! mnumpacketstoread(0),! mcurrentpacket(0),! misdone(false),! mislooping(false) { } 2. Stop(Record) SpeakHereController StopRecord 1) stoprecord recorder AQRecorder::StopRecord ( ) 2) player AQPlayer::DisposeQueue(Boolean indisposefile) SpeakHereController::stopRecord - (void)stoprecord {... recorder->stoprecord( } player->disposequeue(true... // dispose the previous playback queue 1. avtouch Queue Classes &( ) Resources 3. 1) AudioQueueRef mqueue AQPlayer::DisposeQueue! if (mqueue)! {!! AudioQueueDispose(mQueue, true!! mqueue = NULL;! } 2) indisposefile( ) Dispose AQPlayer::DisposeQueue ( )! if (indisposefile)! {!! if (maudiofile)!! {!!!!! AudioFileClose(mAudioFile!!! maudiofile = 0;!! }!! if (mfilepath)!! {!!! CFRelease(mFilePath!!! mfilepath = NULL;!! }! }

6 void AQPlayer::DisposeQueue() AudioQueueDispose Disposes of an audio queue. OSStatus AudioQueueDispose ( AudioQueueRef inaq, Boolean inimmediate inaq The audio queue you want to dispose of. inimmediate If you pass true, the audio queue is disposed of immediately (that is, synchronously). If you pass false, disposal does not take place until all enqueued buffers are processed (that is, asynchronously). void AQPlayer::DisposeQueue() AudioFileClose Closes an audio file. OSStatus AudioFileClose ( AudioFileID inaudiofile inaudiofile The file you want to close.

7 void AQPlayer::DisposeQueue() CFRelease Releases a Core Foundation object. void CFRelease ( CFTypeRef cf cf A CFType object to release. This value must not be NULL. 1. avtouch Queue Classes &( ) Resources SpeakHereController stop recorder : AQRecorder stoprecord player : AQPlayer AQRecorder StopRecord AQPlayer DisposeQueue mqueue maudio mfilepath}

8 2. avtouch Audio Classes Queue & Resources 1. SpeakHereController StopRecord AQPlayer::CreateQueueForFile(CFStringRef infilepath) 1) recordfilepath SpeakHereController::stopRecord! // now create a new queue for the recorded file! recordfilepath = (CFStringRef)[NSTemporaryDirectory() 2) recordfilepath player AQPlayer::CreateQueueForFile SpeakHereController::stopRecord ( )! player->createqueueforfile(recordfilepath 2. avtouch Audio Classes Queue & Resources ( ) 2. infilepath mfilepath 1) CFStringRef mfilepath NULL, infilepath 2) mfilepath 3) mfilepath SetupNewQueue AQPlayer::CreateQueueForFile void AQPlayer::CreateQueueForFile(CFStringRef infilepath) {!! CFURLRef sndfile = NULL;...!if (mfilepath == NULL)!! //! {!! mislooping = false;!!!! sndfile = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, infilepath, kcfurlposixpathstyle, false!! if (!sndfile) { printf("can't parse file path\n" return; }!!!!! XThrowIfError(AudioFileOpenURL(sndFile, kaudiofilereadpermission, 0/*inFileTypeHint*/, &maudiofile), "can't open file"!!!! UInt32 size = sizeof(mdataformat!! XThrowIfError(AudioFileGetProperty(mAudioFile, kaudiofilepropertydataformat, &size, &mdataformat), "couldn't get file's data format"!! mfilepath = CFStringCreateCopy(kCFAllocatorDefault, infilepath! } SetupNewQueue(!!... }

9 void AQPlayer::CreateQueueForFile() CFURLCreateWithFileSystemPath Creates a CFURL object using a local file system path string. CFURLRef CFURLCreateWithFileSystemPath ( CFAllocatorRef allocator, CFStringRef filepath, CFURLPathStyle pathstyle, Boolean isdirectory allocator The allocator to use to allocate memory for the new CFURL object. Pass NULL or kcfallocatordefault to use the current default allocator. filepath The path string to convert to a CFURL object. pathstyle isdirectory The operating system path style used in filepath. A Boolean value that specifies whether filepath is treated as a directory path when resolving against relative path components. Pass true if the pathname indicates a directory, false otherwise. void AQPlayer::CreateQueueForFile() AudioFileOpenURL Open an existing audio file specified by a URL. OSStatus AudioFileOpenURL ( CFURLRef infileref, SInt8 inpermissions, AudioFileTypeID infiletypehint, AudioFileID *outaudiofile infileref The URL of an existing audio file. inpermissions infiletypehint outaudiofile The read-write permissions you want to assign to the file. A hint for the file type of the designated file. For files without filename extensions and with types not easily or uniquely determined from the data (such as ADTS or AC3), use this hint to indicate the file type. Otherwise, pass 0. On output, a pointer to the newly opened audio file.

10 void AQPlayer::CreateQueueForFile() AudioFileGetProperty Gets the value of an audio file property. OSStatus AudioFileGetProperty ( AudioFileID inaudiofile, AudioFilePropertyID inpropertyid, UInt32 *iodatasize, void *outpropertydata inaudiofile inpropertyid iodatasize outpropertydata The audio file you want to obtain a property value from. The property whose value you want. On input, the size of the buffer passed in the outpropertydata parameter. On output, the number of bytes written to the buffer. Use the AudioFileGetPropertyInfo function to obtain the size of the property value. On output, the value of the property specified in the inpropertyid parameter. void AQPlayer::CreateQueueForFile() CFStringCreateCopy Creates an immutable copy of a string. CFStringRef CFStringCreateCopy ( CFAllocatorRef alloc, CFStringRef thestring alloc The allocator to use to allocate memory for the new string. Pass NULL or kcfallocatordefault to use the current default allocator. thestring The string to copy.

11 2. avtouch Audio Classes Queue & Resources ( ) SpeakHereController stop recorder : AQRecorder stoprecord player : AQPlayer AQRecorder StopRecord AQPlayer DisposeQueue mqueue recordfilepath maudio mfilepath} CreateQueueForFile 2. avtouch Audio Classes Queue & Resources ( ) 3. Queue 1) Queue AQPlayer::SetupNewQueue! XThrowIfError(AudioQueueNewOutput(&mDataFormat, AQPlayer::AQBufferCallback, this,!!!!!!!! CFRunLoopGetCurrent(), kcfrunloopcommonmodes, 0, &mqueue), "AudioQueueNew failed" 2) AQPlayer::SetupNewQueue! UInt32 maxpacketsize;! UInt32 size = sizeof(maxpacketsize! XThrowIfError(AudioFileGetProperty(mAudioFile, kaudiofilepropertypacketsizeupperbound, &size, &maxpacketsize), "couldn't get file's max packet size" 3) CalculateBytesForTime AQPlayer::SetupNewQueue! // adjust buffer size to represent about a half second of audio based on this format! UInt32 bufferbytesize;! CalculateBytesForTime (mdataformat, maxpacketsize, kbufferdurationseconds, &bufferbytesize, &mnumpacketstoread

12 void AQPlayer::SetupNewQueue() AudioQueueNewOutput Creates a new playback audio queue object. OSStatus AudioQueueNewOutput ( const AudioStreamBasicDescription AudioQueueOutputCallback void CFRunLoopRef CFStringRef UInt32 AudioQueueRef *informat, incallbackproc, *inuserdata, incallbackrunloop, incallbackrunloopmode, inflags, *outaq informat incallbackproc inuserdata incallbackrunloop incallbackrunloopm ode The data format of the audio to play. For linear PCM, only interleaved formats are supported. Compressed formats are also supported. A callback function to use with the playback audio queue. The audio queue invokes the callback when the audio queue has finished acquiring a buffer A custom data structure for use with the callback function. The event loop on which the callback function pointed to by the incallbackproc parameter is to be called. If you specify NULL, the callback is invoked on one of the audio queue s internal threads. The run loop mode in which to invoke the callback function specified in the incallbackproc parameter. inflags Reserved for future use. Must be 0. outaq On output, the newly created playback audio queue object. void AQPlayer::SetupNewQueue() AudioFileGetProperty Gets the value of an audio file property. OSStatus AudioFileGetProperty ( AudioFileID inaudiofile, AudioFilePropertyID inpropertyid, UInt32 *iodatasize, void *outpropertydata inaudiofile inpropertyid iodatasize outpropertydata The audio file you want to obtain a property value from. The property whose value you want. On input, the size of the buffer passed in the outpropertydata parameter. On output, the number of bytes written to the buffer. Use the AudioFileGetPropertyInfo function to obtain the size of the property value. On output, the value of the property specified in the inpropertyid parameter.

13 2. avtouch Audio Classes Queue & Resources ( ) SpeakHereController stop recorder : AQRecorder stoprecord player : AQPlayer AQRecorder StopRecord AQPlayer DisposeQueue mqueue recordfilepath maudio mfilepath} CreateQueueForFile SetupNewQueue 2. avtouch Audio Classes Queue & Resources ( ) 4. 1). 16K~64K ( ) AQPlayer::CalculateBytesForTime // we only use time here as a guideline // we're really trying to get somewhere between 16K and 64K buffers, // but not allocate too much if we don't need it static const int maxbuffersize = 0x10000; // limit size to 64K static const int minbuffersize = 0x4000; // limit size to 16K 2) AQPlayer:: CalculateBytesForTime! if (indesc.mframesperpacket) {!! Float64 numpacketsfortime = indesc.msamplerate / indesc.mframesperpacket * inseconds;!! *outbuffersize = numpacketsfortime * inmaxpacketsize;! } else {!! *outbuffersize = maxbuffersize > inmaxpacketsize? maxbuffersize : inmaxpacketsize;! } 3) AQPlayer:: CalculateBytesForTime! // we're going to limit our size to our default! if (*outbuffersize > maxbuffersize && *outbuffersize > inmaxpacketsize)!! *outbuffersize = maxbuffersize;! else {!! // also make sure we're not too small - we don't want to go the disk for too small chunks!! if (*outbuffersize < minbuffersize)!!! *outbuffersize = minbuffersize;! } *outnumpackets = *outbuffersize / inmaxpacketsize;

14 2. avtouch Audio Classes Queue & Resources ( ) SpeakHereController stop recorder : AQRecorder stoprecord player : AQPlayer AQRecorder StopRecord AQPlayer DisposeQueue mqueue recordfilepath maudio mfilepath} CreateQueueForFile SetupNewQueue CalculateBytesForTime 2. avtouch Audio Classes Queue & Resources ( ) 5. Queue 1), Queue AQPlayer::SetupNewQueue! // (2) If the file has a cookie, we should get it and set it on the AQ! size = sizeof(uint32! OSStatus result = AudioFileGetPropertyInfo (maudiofile, kaudiofilepropertymagiccookiedata, &size, NULL!! if (!result && size) {!! char* cookie = new char [size];!!!! XThrowIfError (AudioFileGetProperty (maudiofile, kaudiofilepropertymagiccookiedata, &size, cookie), "get cookie from file"!! XThrowIfError (AudioQueueSetProperty(mQueue, kaudioqueueproperty_magiccookie, cookie, size), "set cookie on queue"!! delete [] cookie;! } 2) AQPlayer::SetupNewQueue! // channel layout?! result = AudioFileGetPropertyInfo(mAudioFile, kaudiofilepropertychannellayout, &size, NULL! if (result == noerr && size > 0) {!! AudioChannelLayout *acl = (AudioChannelLayout *)malloc(size!! XThrowIfError(AudioFileGetProperty(mAudioFile, kaudiofilepropertychannellayout, &size, acl), "get audio file's channel layout"!! XThrowIfError(AudioQueueSetProperty(mQueue, kaudioqueueproperty_channellayout, acl, size), "set channel layout on queue"!! free(acl! }

15 void AQPlayer::SetupNewQueue() AudioFileGetPropertyInfo Gets information about an audio file property, including the size of the property value and whether the value is writable. OSStatus AudioFileGetPropertyInfo ( AudioFileID inaudiofile, AudioFilePropertyID inpropertyid, UInt32 *outdatasize, UInt32 *iswritable inaudiofile The audio file you want to obtain property value information from. inpropertyid The property whose value information you want. outdatasize On output, the size in bytes of the property value. iswritable On output, equals 1 if the property is writable, or 0 if it is read-only. void AQPlayer::SetupNewQueue() AudioQueueSetProperty Sets an audio queue property value. OSStatus AudioQueueSetProperty ( AudioQueueRef inaq, AudioQueuePropertyID inid, const void *indata, UInt32 indatasize inaq inid indata The audio queue that you want to set a property value on. The ID of the property whose value you want to set. The property value to set. iodatasize The size of the property data.

16 void AQPlayer::SetupNewQueue() AudioChannelLayout Specifies a channel layout in a file or in hardware. struct AudioChannelLayout { AudioChannelLayoutTag mchannellayouttag; UInt32 mchannelbitmap; UInt32 mnumberchanneldescriptions; AudioChannelDescription mchanneldescriptions[1]; }; typedef struct AudioChannelLayout AudioChannelLayout; mchannellayouttag The AudioChannelLayoutTag value that indicates the layout. mchannelbitmap If mchannellayouttag is set to kaudiochannellayouttag_usechannelbitmap, this field is the channel-use bitmap. mnumberchanneldescriptions The number of items in the mchanneldescriptions array. mchanneldescriptions A variable length array of mnumberchanneldescription elements that describes a layout. If the mchannellayouttag field is set to kaudiochannellayouttag_usechanneldescriptions, use this field to describe the layout. 2. avtouch Audio Classes Queue & Resources ( ) SpeakHereController stop recorder : AQRecorder stoprecord player : AQPlayer AQRecorder StopRecord AQPlayer DisposeQueue mqueue recordfilepath maudio mfilepath} CreateQueueForFile SetupNewQueue CalculateBytesForTime

17 2. avtouch Audio Classes Queue & Resources ( ) 3) Queue AQPlayer::SetupNewQueue! XThrowIfError(AudioQueueAddPropertyListener(mQueue, kaudioqueueproperty_isrunning, isrunningproc, this),!!!! "adding property listener"!! bool isformatvbr = (mdataformat.mbytesperpacket == 0 mdataformat.mframesperpacket == 0! for (int i = 0; i < knumberbuffers; ++i) {!! XThrowIfError(AudioQueueAllocateBufferWithPacketDescriptions(mQueue, bufferbytesize, (isformatvbr? mnumpacketstoread : 0), &mbuffers[i]), "AudioQueueAllocateBuffer failed" 6. ( / ) :. AQPlayer::isRunningProc AQPlayer *THIS = (AQPlayer *)inuserdata; UInt32 size = sizeof(this->misrunning OSStatus result = AudioQueueGetProperty (inaq, kaudioqueueproperty_isrunning, &THIS->mIsRunning, &size! if ((result == noerr) && (!THIS->mIsRunning))! [[NSNotificationCenter defaultcenter] object: nil]; 7. Queue ( ) AQPlayer::SetupNewQueue! // set the volume of the queue! XThrowIfError (AudioQueueSetParameter(mQueue, kaudioqueueparam_volume, 1.0), "set queue volume"!! misinitialized = true; void AQPlayer::SetupNewQueue() AudioQueueAddPropertyListener Adds a property listener callback to an audio queue. OSStatus AudioQueueAddPropertyListener ( AudioQueueRef inaq, AudioQueuePropertyID inid, AudioQueuePropertyListenerProc inproc, void *inuserdata inaq inid inproc The audio queue that you want to assign a property listener callback to. The ID of the property whose changes you want to respond to. The callback to be invoked when the property value changes. inuserdata Custom data for the property listener callback.

18 void AQPlayer::SetupNewQueue() AudioQueueAllocateBufferWithPacketDescriptions Asks an audio queue object to allocate an audio queue buffer with space for packet descriptions. AudioQueueAllocateBufferWithPacketDescriptions( AudioQueueRef inaq, UInt32 inbufferbytesize, UInt32 innumberpacketdescriptions, AudioQueueBufferRef *outbuffer inaq inbufferbytesize innumberpacketdesc riptions outbuffer The audio queue you want to allocate a buffer. The desired data capacity of the new buffer, in bytes. Appropriate capacity depends on the processing you will perform on the data as well as on the audio data format. The desired size of the packet description array in the new audio queue buffer. On output, points to the newly allocated audio queue buffer. void AQPlayer::SetupNewQueue() AudioQueueSetParameter Sets a playback audio queue parameter value. OSStatus AudioQueueSetParameter ( AudioQueueRef inaq, AudioQueueParameterID inparamid, AudioQueueParameterValue invalue inaq The playback audio queue that you want to set a parameter value on. inparamid The ID of the parameter you want to set. invalue The parameter value to set.

19 2. avtouch Audio Classes Queue & Resources ( ) SpeakHereController stop recorder : AQRecorder stoprecord player : AQPlayer AQRecorder StopRecord AQPlayer DisposeQueue mqueue recordfilepath maudio mfilepath} CreateQueueForFile SetupNewQueue CalculateBytesForTime isrunningproc Playback Flow

20 1. StartQueue avtouch Classes & Resources 1. Play SpeakHereController IBAction play SpeakHereController::play - (IBAction)play:(id)sender {... } 2. AQPlayer StartQueue SpeakHereController::play recorder->startrecord(cfstr("recordedfile.caf") 1. StartQueue avtouch Classes & Resources SpeakHereController stop recorder : AQRecorder stoprecord player : AQPlayer AQRecorder StopRecord play AQPlayer recordfilepath DisposeQueue mqueue maudio mfilepath} CreateQueueForFile SetupNewQueue StartQueue CalculateBytesForTime isrunningproc

21 2. avtouch Queue Classes & Resources 1. (mfilepath) (mqueue) - mfilepath CreateQueueForFile AQPlayer::StartQueue! // if we have a file but no queue, create one now! if ((mqueue == NULL) && (mfilepath!= NULL))!! CreateQueueForFile(mFilePath 2. AQPlayer::StartQueue! // if we are not resuming, we also should restart the file read index! if (!inresume)!! mcurrentpacket = 0;! 2. avtouch Queue Classes & Resources SpeakHereController stop recorder : AQRecorder stoprecord player : AQPlayer AQRecorder StopRecord play AQPlayer recordfilepath DisposeQueue mqueue maudio mfilepath} CreateQueueForFile SetupNewQueue StartQueue mfilepath CalculateBytesForTime isrunningproc

22 2. avtouch Queue Classes & Resources 3., AQBufferCallback AQPlayer::StartQueue! // prime the queue with some data before starting! for (int i = 0; i < knumberbuffers; ++i) {!! AQBufferCallback (this, mqueue, mbuffers[i]!!!! }! 4. Queue AQPlayer::AQBufferCallback! if (THIS->mIsDone) return;! UInt32 numbytes;! UInt32 npackets = THIS->GetNumPacketsToRead(! OSStatus result = AudioFileReadPackets(THIS->GetAudioFileID(), false, &numbytes, incompleteaqbuffer->mpacketdescriptions, THIS->GetCurrentPacket(), &npackets, incompleteaqbuffer->maudiodata! if (result)!! printf("audiofilereadpackets failed: %d", result! if (npackets > 0) {!! incompleteaqbuffer->maudiodatabytesize = numbytes;!!!! incompleteaqbuffer->mpacketdescriptioncount = npackets;!!!! AudioQueueEnqueueBuffer(inAQ, incompleteaqbuffer, 0, NULL!! THIS->mCurrentPacket = (THIS->GetCurrentPacket() + npackets! } void AQPlayer::AQBufferCallback() AudioFileReadPackets Reads a fixed duration of audio data from an audio file. OSStatus AudioFileReadPackets ( AudioFileID inaudiofile, Boolean inusecache, UInt32 *outnumbytes, AudioStreamPacketDescription *outpacketdescriptions, SInt64 instartingpacket, UInt32 *ionumpackets, void *outbuffer inaudiofile inusecache outnumbytes outpacketdescripti ons instartingpacket ionumpackets outbuffer The audio file whose audio packets you want to read. Set to true to cache the data. Otherwise, set to false. On output, the number of bytes actually read. On output, an array of packet descriptions for the packets that were read. The array that you pass must be large enough to accommodate descriptions for the number of packets requested in the ionumpackets parameter. This parameter applies only to variable bit-rate data. If the file being read contains constant bit-rate (CBR) data, such as linear PCM, this parameter does not get filled. Pass NULL if the file s data format is CBR. The packet index of the first packet you want to read. On input, the number of packets to read. On output, the number of packets actually read. Memory that you allocate to hold the read packets. Determine an appropriate size by multiplying the number of packets requested (in the ionumpackets parameter) by the maximum (or upper bound for) packet size of the audio file. For uncompressed audio formats, a packet is equal to a frame.

23 void AQPlayer::AQBufferCallback() AudioQueueEnqueueBuffer Adds a buffer to the buffer queue of a recording or playback audio queue. OSStatus AudioQueueEnqueueBuffer ( AudioQueueRef inaq, AudioQueueBufferRef inbuffer, UInt32 innumpacketdescs, const AudioStreamPacketDescription *inpacketdescs inaq The audio queue that owns the audio queue buffer. inbuffer innumpacketdescs inpacketdescs The audio queue buffer to add to the buffer queue. The number of packets of audio data in the inbuffer parameter. Use a value of 0 for any of the following situations: When playing a constant bit rate (CBR) format. When the audio queue is a recording (input) audio queue. When the buffer you are reenqueuing was allocated with the AudioQueueAllocateBufferWithPacketDescriptions function. An array of packet descriptions. Use a value of NULL for any of the following situations: When playing a constant bit rate (CBR) format. When the audio queue is an input (recording) audio queue. When the buffer you are reenqueuing was allocated with the AudioQueueAllocateBufferWithPacketDescriptions function. 2. avtouch Queue Classes & Resources SpeakHereController stop recorder : AQRecorder stoprecord player : AQPlayer AQRecorder StopRecord play AQPlayer recordfilepath DisposeQueue mqueue maudio mfilepath} CreateQueueForFile SetupNewQueue StartQueue mfilepath CalculateBytesForTime AQBufferCallback isrunningproc

24 avtouch 3. Classes & Resources 1. AQPlayer::StartQueue return AudioQueueStart(mQueue, NULL void AQPlayer::StartRecord() AudioQueueStart Begins playing or recording audio. OSStatus AudioQueueStart ( AudioQueueRef inaq, const AudioTimeStamp *instarttime inaq The audio queue to start. instarttime The time at which the audio queue should start.

25 Stop Playback Flow 1. PauseQueue avtouch Classes & Resources 1. 1) Stop SpeakHereController pauseplayqueue 2) AQPlayer PauseQueue SpeakHereController::pausePlayQueue -(void)pauseplayqueue {! player->pausequeue(! playbackwaspaused = YES; } 2. mqueue return AQPlayer::PauseQueue OSStatus AQPlayer::PauseQueue() {! OSStatus result = AudioQueuePause(mQueue! return result; }

26 void AQPlayer::PauseQueue() AudioQueuePause Pauses audio playback or recording. OSStatus AudioQueuePause ( AudioQueueRef inaq inaq The audio queue to pause. Discussion Pausing an audio queue does not affect buffers or reset the audio queue. To resume playback or recording, call AudioQueueStart. 2. StopQueue avtouch Classes & Resources 1. 1) SpeakHereController stopplayqueue 2) AQPlayer StopQueue SpeakHereController::stopPlayQueue -(void)stopplayqueue {! player->stopqueue(! [lvlmeter_in setaq: nil];! btn_record.enabled = YES; } 2. mqueue return AQPlayer::PauseQueue OSStatus AQPlayer::StopQueue() {! OSStatus result = AudioQueueStop(mQueue, true! if (result) printf("error STOPPING QUEUE!\n"! return result; }

27 void AQPlayer::StopQueue() AudioQueueStop Stops playing or recording audio. OSStatus AudioQueueStop ( AudioQueueRef inaq, Boolean inimmediate inaq The audio queue to stop. inimmediate If you pass true, stopping occurs immediately (that is, synchronously). If you pass false, the function returns immediately, but the audio queue does not stop until its queued buffers are played or recorded (that is, the stop occurs asynchronously). Discussion This function resets an audio queue, stops the audio hardware associated with the queue if it is not in use by other audio services, and stops the audio queue. When recording, this function is typically invoked by a user. When playing back, a playback audio queue callback should call this function when there is no more audio to play. 2. avtouch Queue Classes & Resources SpeakHereController stop recorder : AQRecorder stoprecord player : AQPlayer AQRecorder StopRecord play pauseplayqueue stopplayqueue AQPlayer PauseQueue StopQueue recordfilepath DisposeQueue mqueue maudio mfilepath} CreateQueueForFile SetupNewQueue StartQueue mfilepath CalculateBytesForTime AQBufferCallback isrunningproc

28 avtouch 3. Classes & Resources 1. SpeakHereController::dealloc - (void)dealloc {! [btn_record release];! [btn_play release];! [filedescription release];! [lvlmeter_in release];!! delete player;! delete recorder;!! [super dealloc]; } 2. AQPlayer AQPlayer::~AQPlayer AQPlayer::~AQPlayer() {! DisposeQueue(true }

Playing & Recording Audio Audio Queue Services Recording - AQRecorder Class

Playing & Recording Audio Audio Queue Services Recording - AQRecorder Class Playing & Recording Audio Audio Queue Services Recording - AQRecorder Class 10 2010-2 1. AQRecorder 2. Classes & Resources 3. Class 4. AQRecorder Class 5. AQRecorder.h 6. Start Recording Flow 7. Stop Recording

More information

Playing & Recording Audio Audio Queue Services Playback

Playing & Recording Audio Audio Queue Services Playback Playing & Recording Audio Audio Queue Services Playback The most common scenario : basic playing back an on-disk file 11 2010-2 iphone Application 1. 2. Playback Audio Queue Callback 1. Playback Audio

More information

Audio Queue Services. Dave

Audio Queue Services. Dave Audio Queue Services Dave Dribin @ddribin Playing Audio on iphone OS Playing Audio on iphone OS Media Player Framework Playing Audio on iphone OS Media Player Framework AV Foundation Framework Playing

More information

Contents. Introduction 7. What Is Core Audio? 10. Core Audio Essentials 19. Organization of This Document 8 See Also 8

Contents. Introduction 7. What Is Core Audio? 10. Core Audio Essentials 19. Organization of This Document 8 See Also 8 Core Audio Overview Contents Introduction 7 Organization of This Document 8 See Also 8 What Is Core Audio? 10 Core Audio in ios and OS X 10 A Little About Digital Audio and Linear PCM 12 Audio Units 12

More information

Audio Unit Properties Reference

Audio Unit Properties Reference Contents Audio Unit Properties Reference 4 Overview 4 Functions 5 AudioUnitDisplayTypeIsCubed 5 AudioUnitDisplayTypeIsCubeRoot 5 AudioUnitDisplayTypeIsExponential 6 AudioUnitDisplayTypeIsLogarithmic 6

More information

AVAudioPlayer. avtouch Application

AVAudioPlayer. avtouch Application AVAudioPlayer avtouch Application iphone Application Index 1. iphone Application 1) iphone Application 2) iphone Application Main Method 3) iphone Application nib(.xib) 2. avtouch Application 1) avtouch

More information

Short Notes of CS201

Short Notes of CS201 #includes: Short Notes of CS201 The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with < and > if the file is a system

More information

CS201 - Introduction to Programming Glossary By

CS201 - Introduction to Programming Glossary By CS201 - Introduction to Programming Glossary By #include : The #include directive instructs the preprocessor to read and include a file into a source code file. The file name is typically enclosed with

More information

#include <tobii/tobii.h> char const* tobii_error_message( tobii_error_t error );

#include <tobii/tobii.h> char const* tobii_error_message( tobii_error_t error ); tobii.h Thread safety The tobii.h header file collects the core API functions of stream engine. It contains functions to initialize the API and establish a connection to a tracker, as well as enumerating

More information

AVAudioRecorder & System Sound Services

AVAudioRecorder & System Sound Services AVAudioRecorder & System Sound Services Dept. of Multimedia Science, Sookmyung Women s University. prof. JongWoo Lee Index AVAudioRecorder? - (AudioRecorder) System Sound Service? - (SysSound) AVAudioRecorder

More information

Common Misunderstandings from Exam 1 Material

Common Misunderstandings from Exam 1 Material Common Misunderstandings from Exam 1 Material Kyle Dewey Stack and Heap Allocation with Pointers char c = c ; char* p1 = malloc(sizeof(char)); char** p2 = &p1; Where is c allocated? Where is p1 itself

More information

INTERFACING REAL-TIME AUDIO AND FILE I/O

INTERFACING REAL-TIME AUDIO AND FILE I/O INTERFACING REAL-TIME AUDIO AND FILE I/O Ross Bencina portaudio.com rossbencina.com rossb@audiomulch.com @RossBencina Example source code: https://github.com/rossbencina/realtimefilestreaming Q: How to

More information

QNX SDK for Apps and Media 1.1. Multimedia Playlist Library Reference

QNX SDK for Apps and Media 1.1. Multimedia Playlist Library Reference QNX SDK for Apps and Media 1.1 Multimedia Playlist Library Reference 2013 2015, QNX Software Systems Limited, a subsidiary of BlackBerry Limited. All rights reserved. QNX Software Systems Limited 1001

More information

Mac OS X Server Developer s Kit. Apple Filing Protocol Client

Mac OS X Server Developer s Kit. Apple Filing Protocol Client Mac OS X Server Developer s Kit Apple Filing Protocol Client apple January 2001 apple Apple Computer, Inc. 1999-2001 Apple Computer, Inc. All rights reserved. No part of this publication may be reproduced,

More information

Chapter 3: Process Concept

Chapter 3: Process Concept Chapter 3: Process Concept Chapter 3: Process Concept Process Concept Process Scheduling Operations on Processes Inter-Process Communication (IPC) Communication in Client-Server Systems Objectives 3.2

More information

Chapter 3: Process Concept

Chapter 3: Process Concept Chapter 3: Process Concept Chapter 3: Process Concept Process Concept Process Scheduling Operations on Processes Inter-Process Communication (IPC) Communication in Client-Server Systems Objectives 3.2

More information

Chapter 3: Process Concept

Chapter 3: Process Concept Chapter 3: Process Concept Silberschatz, Galvin and Gagne 2013! Chapter 3: Process Concept Process Concept" Process Scheduling" Operations on Processes" Inter-Process Communication (IPC)" Communication

More information

QNX SDK for Apps and Media 1.0. Multimedia Playlist Library Reference

QNX SDK for Apps and Media 1.0. Multimedia Playlist Library Reference QNX SDK for Apps and Media 1.0 QNX SDK for Apps and Media 1.0 Multimedia Playlist Library Reference 2013 2014, QNX Software Systems Limited, a subsidiary of BlackBerry. All rights reserved. QNX Software

More information

Opus Generated by Doxygen Thu May :22:05

Opus Generated by Doxygen Thu May :22:05 Opus 0.9.14 Generated by Doxygen 1.7.1 Thu May 17 2012 15:22:05 Contents 1 Opus 1 2 Module Index 3 2.1 Modules................................. 3 3 File Index 5 3.1 File List.................................

More information

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS PAUL L. BAILEY Abstract. This documents amalgamates various descriptions found on the internet, mostly from Oracle or Wikipedia. Very little of this

More information

SIMATIC Industrial software Readme SIMATIC S7-PLCSIM Advanced V2.0 SP1 Readme

SIMATIC Industrial software Readme SIMATIC S7-PLCSIM Advanced V2.0 SP1 Readme SIMATIC Industrial software Readme General information Content This Readme file contains information about SIMATIC S7-PLCSIM Advanced V2.0 SP1. The information should be considered more up-to-date than

More information

Building a (Core) Foundation. Rob Napier

Building a (Core) Foundation. Rob Napier Building a (Core) Foundation Rob Napier A little background Mac OS X since 10.4 iphoneos since release Cisco Jabber, The Daily, RNCryptor Focus on low-level Today: Mac developer for... KACE NAPIER KUMAR

More information

PDF Document structure, that need for managing of PDF file. It uses in all functions from EMF2PDF SDK.

PDF Document structure, that need for managing of PDF file. It uses in all functions from EMF2PDF SDK. EMF2PDF SDK Pilot Structures struct pdf_document { PDFDocument4 *pdfdoc; }; PDF Document structure, that need for managing of PDF file. It uses in all functions from EMF2PDF SDK. typedef enum { conone

More information

As you convert your QuickDraw application to one that uses only Quartz, there are two primary issues you ll face with respect to PICT data:

As you convert your QuickDraw application to one that uses only Quartz, there are two primary issues you ll face with respect to PICT data: C H A P T E R 4 Converting PICT Data The QuickDraw picture (PICT) format is the graphics metafile format in Mac OS 9 and earlier. A picture contains a recorded sequence of QuickDraw imaging operations

More information

CS24 Week 4 Lecture 2

CS24 Week 4 Lecture 2 CS24 Week 4 Lecture 2 Kyle Dewey Overview Linked Lists Stacks Queues Linked Lists Linked Lists Idea: have each chunk (called a node) keep track of both a list element and another chunk Need to keep track

More information

Motivation was to facilitate development of systems software, especially OS development.

Motivation was to facilitate development of systems software, especially OS development. A History Lesson C Basics 1 Development of language by Dennis Ritchie at Bell Labs culminated in the C language in 1972. Motivation was to facilitate development of systems software, especially OS development.

More information

JAVA MOCK TEST JAVA MOCK TEST II

JAVA MOCK TEST JAVA MOCK TEST II http://www.tutorialspoint.com JAVA MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to Java Framework. You can download these sample mock tests at your

More information

HikVision Mpeg4 linux Player SDK

HikVision Mpeg4 linux Player SDK HikVision Mpeg4 linux Player SDK Version 3.8(build1111) (2004.11.11) Email: hkvs@hikvision.com 0571-88075998-8025 Introduction HikVision Mpeg4/H264 Linux Player SDK is developed based on SDL(Simple DirectMedia

More information

elastique efficient time stretching SDK by zplane.development (c) 2017 zplane.development GmbH & Co. KG

elastique efficient time stretching SDK by zplane.development (c) 2017 zplane.development GmbH & Co. KG elastique efficient time stretching SDK by zplane.development (c) 2017 zplane.development GmbH & Co. KG May 23, 2017 Contents 1 elastique Efficient 3.x Documentation 2 1.1 Introduction...............................

More information

Process. Heechul Yun. Disclaimer: some slides are adopted from the book authors slides with permission 1

Process. Heechul Yun. Disclaimer: some slides are adopted from the book authors slides with permission 1 Process Heechul Yun Disclaimer: some slides are adopted from the book authors slides with permission 1 Recap OS services Resource (CPU, memory) allocation, filesystem, communication, protection, security,

More information

Process. Heechul Yun. Disclaimer: some slides are adopted from the book authors slides with permission

Process. Heechul Yun. Disclaimer: some slides are adopted from the book authors slides with permission Process Heechul Yun Disclaimer: some slides are adopted from the book authors slides with permission 1 Recap OS services Resource (CPU, memory) allocation, filesystem, communication, protection, security,

More information

Graphics & Animation: 2D Drawing

Graphics & Animation: 2D Drawing Core Graphics Framework Reference Graphics & Animation: 2D Drawing 2009-05-14 Apple Inc. 2009 Apple Inc. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system,

More information

Appendix A Pseudocode of the wlan_mac Process Model in OPNET

Appendix A Pseudocode of the wlan_mac Process Model in OPNET Appendix A Pseudocode of the wlan_mac Process Model in OPNET static void wlan_frame_transmit () { char msg_string [120]; char msg_string1 [120]; WlanT_Hld_List_Elem* hld_ptr; const WlanT_Data_Header_Fields*

More information

CS24 Week 4 Lecture 1

CS24 Week 4 Lecture 1 CS24 Week 4 Lecture 1 Kyle Dewey Overview Additional use of const in C++ List ADT Array Lists Linked Lists Additional Use of const We ve seen const already in two positions: What is pointed to is constant

More information

CHAPTER 3 - PROCESS CONCEPT

CHAPTER 3 - PROCESS CONCEPT CHAPTER 3 - PROCESS CONCEPT 1 OBJECTIVES Introduce a process a program in execution basis of all computation Describe features of processes: scheduling, creation, termination, communication Explore interprocess

More information

Concurrency: Mutual Exclusion and Synchronization. Concurrency

Concurrency: Mutual Exclusion and Synchronization. Concurrency Concurrency: Mutual Exclusion and Synchronization Chapter 5 1 Concurrency Multiple applications Structured applications Operating system structure 2 1 Concurrency 3 Difficulties of Concurrency Sharing

More information

Multicast Dissemination Protocol (MDP) Developer's Guide

Multicast Dissemination Protocol (MDP) Developer's Guide Multicast Dissemination Protocol (MDP) Developer's Guide Brian Adamson Newlink Global Engineering Corporation Joe Macker Naval Research Laboratory 1

More information

Kevin van Vechten Core OS

Kevin van Vechten Core OS Kevin van Vechten Core OS 2 3 Bill Bumgarner 4 (lambda (a) (add a d)) 10 timesrepeat:[pen turn:d; draw] z.each { val puts(val + d.to_s)} repeat(10, ^{ putc('0'+ d); }); 5 6 7 8 ^ 9 [myset objectspassingtest:

More information

CS 140 Project 4 File Systems Review Session

CS 140 Project 4 File Systems Review Session CS 140 Project 4 File Systems Review Session Prachetaa Due Friday March, 14 Administrivia Course withdrawal deadline today (Feb 28 th ) 5 pm Project 3 due today (Feb 28 th ) Review section for Finals on

More information

Chapter 3: Processes. Operating System Concepts 9 th Edition

Chapter 3: Processes. Operating System Concepts 9 th Edition Chapter 3: Processes Silberschatz, Galvin and Gagne 2013 Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication

More information

Call DLL from Limnor Applications

Call DLL from Limnor Applications Call DLL from Limnor Applications There is a lot of computer software in the format of dynamic link libraries (DLL). DLLCaller performer allows your applications to call DLL functions directly. Here we

More information

ENGR 3950U / CSCI 3020U Midterm Exam SOLUTIONS, Fall 2012 SOLUTIONS

ENGR 3950U / CSCI 3020U Midterm Exam SOLUTIONS, Fall 2012 SOLUTIONS SOLUTIONS ENGR 3950U / CSCI 3020U (Operating Systems) Midterm Exam October 23, 2012, Duration: 80 Minutes (10 pages, 12 questions, 100 Marks) Instructor: Dr. Kamran Sartipi Question 1 (Computer Systgem)

More information

CS510 Operating System Foundations. Jonathan Walpole

CS510 Operating System Foundations. Jonathan Walpole CS510 Operating System Foundations Jonathan Walpole The Process Concept 2 The Process Concept Process a program in execution Program - description of how to perform an activity instructions and static

More information

Compositional C++ Page 1 of 17

Compositional C++ Page 1 of 17 Compositional C++ Page 1 of 17 Compositional C++ is a small set of extensions to C++ for parallel programming. OVERVIEW OF C++ With a few exceptions, C++ is a pure extension of ANSI C. Its features: Strong

More information

When EMG starts, the shared library that contains the plugin is loaded and the API function create_config() is called:

When EMG starts, the shared library that contains the plugin is loaded and the API function create_config() is called: EMG 6 C Plugin API Overview The functionality in EMG can be extended by writing a plugin. For example, plugins can be used to reject messages (spam filtering, blacklisting etc), implementing custom routing

More information

Armide Documentation. Release Kyle Mayes

Armide Documentation. Release Kyle Mayes Armide Documentation Release 0.3.1 Kyle Mayes December 19, 2014 Contents 1 Introduction 1 1.1 Features.................................................. 1 1.2 License..................................................

More information

Anybus CompactCom. Host Application Implementation Guide. Doc.Id. HMSI Doc. Rev Connecting DevicesTM

Anybus CompactCom. Host Application Implementation Guide. Doc.Id. HMSI Doc. Rev Connecting DevicesTM Anybus CompactCom Doc. Rev. 1.10 Connecting DevicesTM +$/067$' &+,&$*2.$5/658+( 72.

More information

Pointers, Pointers, Pointers!

Pointers, Pointers, Pointers! Pointers, Pointers, Pointers! Pointers, Pointers, Pointers, Pointers, Pointers, Pointers, Pointers, Pointers, Pointers, Pointers, Pointers, Pointers, Pointers! Colin Gordon csgordon@cs.washington.edu University

More information

G3 PHYSICAL LAYER API SPECIFICATION

G3 PHYSICAL LAYER API SPECIFICATION G3 PHYSICAL LAYER API SPECIFICATION Document Revision: 0.6 Issue Date: 08 August, 2011 Revision History Revision Draft Author Date Comment 0.0 Initial version Susan Yim 01/21/2010 0.1 PHY Lib release 1.0

More information

Requirements. Left To Implement. Design. Extended Plugin Interface

Requirements. Left To Implement. Design. Extended Plugin Interface Requirements Left To Implement Design Extended Plugin Interface Pausible Player for Libao Players Overview Libao Driver Speaker Process Player Plugin Main Server MCDP Alternative Design To Do Future Developments

More information

ECE454 Tutorial. June 16, (Material prepared by Evan Jones)

ECE454 Tutorial. June 16, (Material prepared by Evan Jones) ECE454 Tutorial June 16, 2009 (Material prepared by Evan Jones) 2. Consider the following function: void strcpy(char* out, char* in) { while(*out++ = *in++); } which is invoked by the following code: void

More information

Last Class: Synchronization Problems. Need to hold multiple resources to perform task. CS377: Operating Systems. Real-world Examples

Last Class: Synchronization Problems. Need to hold multiple resources to perform task. CS377: Operating Systems. Real-world Examples Last Class: Synchronization Problems Reader Writer Multiple readers, single writer In practice, use read-write locks Dining Philosophers Need to hold multiple resources to perform task Lecture 10, page

More information

Memory Management: The process by which memory is shared, allocated, and released. Not applicable to cache memory.

Memory Management: The process by which memory is shared, allocated, and released. Not applicable to cache memory. Memory Management Page 1 Memory Management Wednesday, October 27, 2004 4:54 AM Memory Management: The process by which memory is shared, allocated, and released. Not applicable to cache memory. Two kinds

More information

Quiz 0 Review Session. October 13th, 2014

Quiz 0 Review Session. October 13th, 2014 Quiz 0 Review Session October 13th, 2014 Topics (non-exhaustive) Binary. ASCII. Algorithms. Pseudocode. Source code. Compiler. Object code. Scratch. Statements. Boolean expressions. Conditions. Loops.

More information

Chapter 6: Process Synchronization

Chapter 6: Process Synchronization Chapter 6: Process Synchronization Objectives Introduce Concept of Critical-Section Problem Hardware and Software Solutions of Critical-Section Problem Concept of Atomic Transaction Operating Systems CS

More information

int fnvgetconfig(handle h, UINT32 id, const void *cfg, size_t sz);... 4

int fnvgetconfig(handle h, UINT32 id, const void *cfg, size_t sz);... 4 RP-VL-UTIL-V1 Developer s Guide [ Contents ] 1. Introduction... 1 2. Building Environment... 1 3. Operating Environment... 1 4. Function Explanation... 2 4.1. Common API for Transmitting and Receiving...

More information

Dotstack Porting Guide.

Dotstack Porting Guide. dotstack TM Dotstack Porting Guide. dotstack Bluetooth stack is a C library and several external interfaces that needs to be implemented in the integration layer to run the stack on a concrete platform.

More information

CS5460/6460: Operating Systems. Lecture 11: Locking. Anton Burtsev February, 2014

CS5460/6460: Operating Systems. Lecture 11: Locking. Anton Burtsev February, 2014 CS5460/6460: Operating Systems Lecture 11: Locking Anton Burtsev February, 2014 Race conditions Disk driver maintains a list of outstanding requests Each process can add requests to the list 1 struct list

More information

MBS Xojo AudioPlayer Kit

MBS Xojo AudioPlayer Kit MBS Xojo AudioPlayer Kit Version 1.0, 2015 by Christian Schmitz About the MBS Xojo AudioPlayer Kit 2 AudioPlayer 3 MidiPlayer 4 Interfaces 5 AVErrorMB 5 AVAudioPlayerMB 6 MidiPlayerMB 9 Version History

More information

Chapter 1 Getting Started

Chapter 1 Getting Started Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different

More information

When EMG starts, the shared library that contains the plugin is loaded and this API function is called:

When EMG starts, the shared library that contains the plugin is loaded and this API function is called: EMG plugin API Overview The functionality in EMG can be extended by writing a plugin. These should be written in C, or in some language that can produce a shared library with "C" linkage. Each plugin implements

More information

OptimiData. JPEG2000 Software Development Kit for C/C++ Reference Manual. Version 1.6. from

OptimiData. JPEG2000 Software Development Kit for C/C++  Reference Manual. Version 1.6. from OptimiData for optimized data handling JPEG2000 Software Development Kit for C/C++ Reference Manual Version 1.6 from 2004-07-29 (Windows and Linux Versions) www.optimidata.com OptimiData JPEG2000 C-SDK

More information

Auto-Pipe Software Block Interface v2. Interface. Contents. Auto-Pipe Types. From Auto-Pipe Wiki

Auto-Pipe Software Block Interface v2. Interface. Contents. Auto-Pipe Types. From Auto-Pipe Wiki Auto-Pipe Software Block Interface v2 From Auto-Pipe Wiki Contents 1 Interface 1.1 Auto-Pipe Types 1.2 AutoPipe Functions 1.3 Block Structure 1.4 Block Functions 2 Signaling 2.1 Stop Signal (type 0) 2.2

More information

Motivation was to facilitate development of systems software, especially OS development.

Motivation was to facilitate development of systems software, especially OS development. A History Lesson C Basics 1 Development of language by Dennis Ritchie at Bell Labs culminated in the C language in 1972. Motivation was to facilitate development of systems software, especially OS development.

More information

BIT Java Programming. Sem 1 Session 2011/12. Chapter 2 JAVA. basic

BIT Java Programming. Sem 1 Session 2011/12. Chapter 2 JAVA. basic BIT 3383 Java Programming Sem 1 Session 2011/12 Chapter 2 JAVA basic Objective: After this lesson, you should be able to: declare, initialize and use variables according to Java programming language guidelines

More information

Suggested Solutions (Midterm Exam October 27, 2005)

Suggested Solutions (Midterm Exam October 27, 2005) Suggested Solutions (Midterm Exam October 27, 2005) 1 Short Questions (4 points) Answer the following questions (True or False). Use exactly one sentence to describe why you choose your answer. Without

More information

Queues. A queue is a special type of structure that can be used to maintain data in an organized way.

Queues. A queue is a special type of structure that can be used to maintain data in an organized way. A queue is a special type of structure that can be used to maintain data in an organized way. This data structure is commonly implemented in one of two ways: as an array or as a linked list. In either

More information

CS240: Programming in C

CS240: Programming in C CS240: Programming in C Lecture 11: Bit fields, unions, pointers to functions Cristina Nita-Rotaru Lecture 11/ Fall 2013 1 Structures recap Holds multiple items as a unit Treated as scalar in C: can be

More information

Caching and Buffering in HDF5

Caching and Buffering in HDF5 Caching and Buffering in HDF5 September 9, 2008 SPEEDUP Workshop - HDF5 Tutorial 1 Software stack Life cycle: What happens to data when it is transferred from application buffer to HDF5 file and from HDF5

More information

Chapter 2. Procedural Programming

Chapter 2. Procedural Programming Chapter 2 Procedural Programming 2: Preview Basic concepts that are similar in both Java and C++, including: standard data types control structures I/O functions Dynamic memory management, and some basic

More information

UPDATES AND CORRECTIONS JANUARY 2002

UPDATES AND CORRECTIONS JANUARY 2002 CARBON PROGRAMMING UPDATES AND CORRECTIONS JANUARY 2002 CONTENTS Errata First Printing 2 Demonstration Program Bug Fixes and Additions 9 1 ERRATA FIRST PRINTING If your copy of Carbon Programming is from

More information

What s New in Core Audio

What s New in Core Audio Media #WWDC14 What s New in Core Audio Session 501 Torrey Holbrook Walker Master of Ceremonies 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission

More information

Robot Raconteur using MATLAB Version 0.8 Beta

Robot Raconteur using MATLAB Version 0.8 Beta Robot Raconteur using MATLAB Version 0.8 Beta http://robotraconteur.com Dr. John Wason Wason Technology, LLC PO Box 669 Tuxedo, NY 10987 wason@wasontech.com http://wasontech.com May 3, 2016 1 Contents

More information

CprE 288 Introduction to Embedded Systems Exam 1 Review. 1

CprE 288 Introduction to Embedded Systems Exam 1 Review.  1 CprE 288 Introduction to Embedded Systems Exam 1 Review http://class.ece.iastate.edu/cpre288 1 Overview of Today s Lecture Announcements Exam 1 Review http://class.ece.iastate.edu/cpre288 2 Announcements

More information

VS1053B PCM Mixer. VSMPG VLSI Solution Audio Decoder. Project Code: Project Name:

VS1053B PCM Mixer. VSMPG VLSI Solution Audio Decoder. Project Code: Project Name: Controlled Document VS1053B PCM Mixer VLSI Solution Audio Decoder Project Code: Project Name: Revision History Rev. Date Author Description 1.1 2011-04-27 Rate configured from AICTRL0 1.0 2011-03-14 Initial

More information

Section 10: Device Drivers, FAT, Queuing Theory, Memory Mapped Files

Section 10: Device Drivers, FAT, Queuing Theory, Memory Mapped Files Section 10: Device Drivers, FAT, Queuing Theory, Memory Mapped Files CS162 Oct 31st, 2017 Contents 1 Warmup: I/O and Device Drivers 2 2 Vocabulary 2 3 Problems 4 3.1 FAT................................................

More information

Media Playback and Recording. CS193W - Spring Lecture 3

Media Playback and Recording. CS193W - Spring Lecture 3 Media Playback and Recording CS193W - Spring 2016 - Lecture 3 Today Images and animated images Text input controller Media playback controller Inline video playback Playing extended audio Recording audio

More information

Deadlock. Lecture 4: Synchronization & Communication - Part 2. Necessary conditions. Deadlock handling. Hierarchical resource allocation

Deadlock. Lecture 4: Synchronization & Communication - Part 2. Necessary conditions. Deadlock handling. Hierarchical resource allocation Lecture 4: Synchronization & ommunication - Part 2 [RTS h 4] Deadlock Priority Inversion & Inheritance Mailbox ommunication ommunication with Objects Deadlock Improper allocation of common resources may

More information

/Users/Bruce/Documents/Devel/LocalizeString/main.c

/Users/Bruce/Documents/Devel/LocalizeString/main.c / main.c LocalizeString XFcn Created by Bruce Martin on 3/26/06. Copyright Martin Solution 2006. All rights reserved. / / Includes / #include "commonext_460.h" #include "InternalsToolbox_460.h" / Defines

More information

Lecture 8 Dynamic Memory Allocation

Lecture 8 Dynamic Memory Allocation Lecture 8 Dynamic Memory Allocation CS240 1 Memory Computer programs manipulate an abstraction of the computer s memory subsystem Memory: on the hardware side 3 @ http://computer.howstuffworks.com/computer-memory.htm/printable

More information

// Initially NULL, points to the dynamically allocated array of bytes. uint8_t *data;

// Initially NULL, points to the dynamically allocated array of bytes. uint8_t *data; Creating a Data Type in C Bytes For this assignment, you will use the struct mechanism in C to implement a data type that represents an array of bytes. This data structure could be used kind of like a

More information

Discovering the ios Instruments Server

Discovering the ios Instruments Server Discovering the ios Instruments Server Troy Bowman Hex-Rays troy@hex-rays.com Recon Montreal 2018 Purpose of This Talk Share our discoveries Document all of our steps Fun! What is Instruments? Instruments

More information

CLD SC58x CDC Library v.1.00 Users Guide Users Guide Revision For Use With Analog Devices ADSP-SC58x Series Processors. Closed Loop Design, LLC

CLD SC58x CDC Library v.1.00 Users Guide Users Guide Revision For Use With Analog Devices ADSP-SC58x Series Processors. Closed Loop Design, LLC CLD SC58x CDC Library v.1.00 Users Guide Users Guide Revision 1.00 For Use With Analog Devices ADSP-SC58x Series Processors Closed Loop Design, LLC 748 S MEADOWS PKWY STE A-9-202 Reno, NV 89521 support@cld-llc.com

More information

Chapter 3: Processes. Operating System Concepts Essentials 8 th Edition

Chapter 3: Processes. Operating System Concepts Essentials 8 th Edition Chapter 3: Processes Silberschatz, Galvin and Gagne 2011 Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication

More information

Copyright 2008 CS655 System Modeling and Analysis. Korea Advanced Institute of Science and Technology

Copyright 2008 CS655 System Modeling and Analysis. Korea Advanced Institute of Science and Technology The Spin Model Checker : Part I Copyright 2008 CS655 System Korea Advanced Institute of Science and Technology System Spec. In Promela Req. Spec. In LTL Overview of the Spin Architecture Spin Model pan.c

More information

PRINCIPLES OF OPERATING SYSTEMS

PRINCIPLES OF OPERATING SYSTEMS PRINCIPLES OF OPERATING SYSTEMS Tutorial-1&2: C Review CPSC 457, Spring 2015 May 20-21, 2015 Department of Computer Science, University of Calgary Connecting to your VM Open a terminal (in your linux machine)

More information

This document contains the questions and solutions to the CS107 midterm given in Winter 2018 by instructor Chris Gregg. This was a 120-minute exam.

This document contains the questions and solutions to the CS107 midterm given in Winter 2018 by instructor Chris Gregg. This was a 120-minute exam. This document contains the questions and solutions to the CS107 midterm given in Winter 2018 by instructor Chris Gregg. This was a 120-minute exam. Midterm questions Problem 1: Bits, bytes, and numbers

More information

Agenda. The main body and cout. Fundamental data types. Declarations and definitions. Control structures

Agenda. The main body and cout. Fundamental data types. Declarations and definitions. Control structures The main body and cout Agenda 1 Fundamental data types Declarations and definitions Control structures References, pass-by-value vs pass-by-references The main body and cout 2 C++ IS AN OO EXTENSION OF

More information

LAB 5, THE HIDDEN DELIGHTS OF LINKED LISTS

LAB 5, THE HIDDEN DELIGHTS OF LINKED LISTS LAB 5, THE HIDDEN DELIGHTS OF LINKED LISTS Questions are based on the Main and Savitch review questions for chapter 5 in the Exam Preparation section of the webct course page. In case you haven t observed

More information

Pointers, Dynamic Data, and Reference Types

Pointers, Dynamic Data, and Reference Types Pointers, Dynamic Data, and Reference Types Review on Pointers Reference Variables Dynamic Memory Allocation The new operator The delete operator Dynamic Memory Allocation for Arrays 1 C++ Data Types simple

More information

Project 5: File Systems

Project 5: File Systems Project 5: File Systems by Ben Pfaff USF modifications by Greg Benson Chapter 1: Project 5: File Systems 1 1 Project 5: File Systems In the previous two assignments, you made extensive use of a file system

More information

APPENDIX A : Example Standard <--Prev page Next page -->

APPENDIX A : Example Standard <--Prev page Next page --> APPENDIX A : Example Standard If you have no time to define your own standards, then this appendix offers you a pre-cooked set. They are deliberately brief, firstly because standards

More information

Logical disks. Bach 2.2.1

Logical disks. Bach 2.2.1 Logical disks Bach 2.2.1 Physical disk is divided into partitions or logical disks Logical disk linear sequence of fixed size, randomly accessible, blocks disk device driver maps underlying physical storage

More information

ADTs Stack and Queue. Outline

ADTs Stack and Queue. Outline Chapter 5 ADTs Stack and Queue Fall 2017 Yanjun Li CS2200 1 Outline Stack Array-based Implementation Linked Implementation Queue Array-based Implementation Linked Implementation Comparison Fall 2017 Yanjun

More information

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL II)

ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL II) ANDROID APPS DEVELOPMENT FOR MOBILE AND TABLET DEVICE (LEVEL II) Media Playback Engine Android provides a media playback engine at the native level called Stagefright that comes built-in with software-based

More information

Vive Input Utility Developer Guide

Vive Input Utility Developer Guide using Valve.VR; public class GetPressDown_SteamVR : MonoBehaviour public SteamVR_ControllerManager manager; private void Update() // get trigger down SteamVR_TrackedObject trackedobj = manager.right.getcomponent();

More information

Chapter 3: Process-Concept. Operating System Concepts 8 th Edition,

Chapter 3: Process-Concept. Operating System Concepts 8 th Edition, Chapter 3: Process-Concept, Silberschatz, Galvin and Gagne 2009 Chapter 3: Process-Concept Process Concept Process Scheduling Operations on Processes Interprocess Communication 3.2 Silberschatz, Galvin

More information

Parallel System Architectures 2016 Lab Assignment 1: Cache Coherency

Parallel System Architectures 2016 Lab Assignment 1: Cache Coherency Institute of Informatics Computer Systems Architecture Jun Xiao Simon Polstra Dr. Andy Pimentel September 1, 2016 Parallel System Architectures 2016 Lab Assignment 1: Cache Coherency Introduction In this

More information

µroar Manual Philipp ph3-der-loewe Schafft

µroar Manual Philipp ph3-der-loewe Schafft µroar Manual Philipp ph3-der-loewe Schafft April 26, 2010 Contents Contens 1 1 Programming with libmuroar 2 1.1 Connecting to sever and creation of streams............ 2 1.2 Portable IO with extended IO

More information

CS11001/CS11002 Programming and Data Structures (PDS) (Theory: 3-1-0)

CS11001/CS11002 Programming and Data Structures (PDS) (Theory: 3-1-0) CS11001/CS11002 Programming and Data Structures (PDS) (Theory: 3-1-0) An interesting definition for stack element The stack element could be of any data type struct stackelement int etype; union int ival;

More information