Mercurial > hg > svcore
comparison data/fileio/CoreAudioFileReader.cpp @ 1527:710e6250a401 zoom
Merge from default branch
author | Chris Cannam |
---|---|
date | Mon, 17 Sep 2018 13:51:14 +0100 |
parents | c380e56c95f5 |
children |
comparison
equal
deleted
inserted
replaced
1324:d4a28d1479a8 | 1527:710e6250a401 |
---|---|
112 return; | 112 return; |
113 } | 113 } |
114 | 114 |
115 UInt32 propsize = sizeof(AudioStreamBasicDescription); | 115 UInt32 propsize = sizeof(AudioStreamBasicDescription); |
116 m_d->err = ExtAudioFileGetProperty | 116 m_d->err = ExtAudioFileGetProperty |
117 (m_d->file, kExtAudioFileProperty_FileDataFormat, &propsize, &m_d->asbd); | 117 (m_d->file, kExtAudioFileProperty_FileDataFormat, &propsize, &m_d->asbd); |
118 | 118 |
119 if (m_d->err) { | 119 if (m_d->err) { |
120 m_error = "CoreAudioReadStream: Error in getting basic description: code " + codestr(m_d->err); | 120 m_error = "CoreAudioReadStream: Error in getting basic description: code " + codestr(m_d->err); |
121 ExtAudioFileDispose(m_d->file); | 121 ExtAudioFileDispose(m_d->file); |
122 return; | 122 return; |
123 } | 123 } |
124 | 124 |
125 m_channelCount = m_d->asbd.mChannelsPerFrame; | 125 m_channelCount = m_d->asbd.mChannelsPerFrame; |
126 m_fileRate = m_d->asbd.mSampleRate; | 126 m_fileRate = m_d->asbd.mSampleRate; |
127 | 127 |
128 SVDEBUG << "CoreAudioFileReader: " << m_channelCount << " channels, " << m_fileRate << " Hz" << endl; | 128 SVDEBUG << "CoreAudioFileReader: " << m_channelCount << " channels, " << m_fileRate << " Hz" << endl; |
129 | 129 |
135 m_d->asbd.mBitsPerChannel = sizeof(float) * 8; | 135 m_d->asbd.mBitsPerChannel = sizeof(float) * 8; |
136 m_d->asbd.mBytesPerFrame = sizeof(float) * m_channelCount; | 136 m_d->asbd.mBytesPerFrame = sizeof(float) * m_channelCount; |
137 m_d->asbd.mBytesPerPacket = sizeof(float) * m_channelCount; | 137 m_d->asbd.mBytesPerPacket = sizeof(float) * m_channelCount; |
138 m_d->asbd.mFramesPerPacket = 1; | 138 m_d->asbd.mFramesPerPacket = 1; |
139 m_d->asbd.mReserved = 0; | 139 m_d->asbd.mReserved = 0; |
140 | 140 |
141 m_d->err = ExtAudioFileSetProperty | 141 m_d->err = ExtAudioFileSetProperty |
142 (m_d->file, kExtAudioFileProperty_ClientDataFormat, propsize, &m_d->asbd); | 142 (m_d->file, kExtAudioFileProperty_ClientDataFormat, propsize, &m_d->asbd); |
143 | 143 |
144 if (m_d->err) { | 144 if (m_d->err) { |
145 m_error = "CoreAudioReadStream: Error in setting client format: code " + codestr(m_d->err); | 145 m_error = "CoreAudioReadStream: Error in setting client format: code " + codestr(m_d->err); |
146 ExtAudioFileDispose(m_d->file); | 146 ExtAudioFileDispose(m_d->file); |
147 return; | 147 return; |