Post

Replies

Boosts

Views

Activity

Reply to MTAudioProcessingTap with kMTAudioProcessingTapCreationFlag_PostEffects not reflecting AVAudioMix volume
I multiplied the samples by the AVPlayer's volume level and then do an RMS calculation on the resulting samples. I send the leftVol and rightVol values off to a NSLevelIndicator instances -- on which I then do a pair of clever NSView overlays to get a lagging indication of peak volume levels.     float scalar = player.volume;     for (NSInteger i=0; i<bufferListInOut->mNumberBuffers; i++)         vDSP_vsmul(bufferListInOut->mBuffers[i].mData, 1, &scalar,                    bufferListInOut->mBuffers[i].mData, 1,                    bufferListInOut->mBuffers[i].mDataByteSize / sizeof(float));     float leftVol, rightVol;     for (NSInteger i=0; i<bufferListInOut->mNumberBuffers; i++) {         AudioBuffer *pBuffer = &bufferListInOut->mBuffers[i];         float rms = 0.0f;         vDSP_rmsqv(pBuffer->mData, 1, &rms, numberFrames*pBuffer->mNumberChannels);         if (i==0)             leftVol = rms;         if (i==1)             rightVol = rms;     }
Feb ’21
Reply to NSCollectionView memory problem
One comment: having a DataSource Delegate and/or a NSCollectionViewDelegate attached to your post-legacy NSCollectionView is a bad idea; it needs to be in a different class/object. In my case, such a situation exhausted available memory with leaked objects.
Jan ’21