mirror of https://github.com/axmolengine/axmol.git
fix AudioEngine bug for iOS, UTF8 filePath (#15743)
* fix AudioEngine bug for iOS, UTF8 filePath Fix bug for apple platform, open audio file failed with chinese App Name. * Update AudioPlayer.mm
This commit is contained in:
parent
67c95549b3
commit
fa4bfe43d8
|
@ -102,7 +102,7 @@ void AudioCache::readDataTask()
|
||||||
AudioBufferList theDataBuffer;
|
AudioBufferList theDataBuffer;
|
||||||
ExtAudioFileRef extRef = nullptr;
|
ExtAudioFileRef extRef = nullptr;
|
||||||
|
|
||||||
NSString *fileFullPath = [[NSString alloc] initWithCString:_fileFullPath.c_str() encoding:[NSString defaultCStringEncoding]];
|
NSString *fileFullPath = [[NSString alloc] initWithCString:_fileFullPath.c_str() encoding:NSUTF8StringEncoding];
|
||||||
auto fileURL = (CFURLRef)[[NSURL alloc] initFileURLWithPath:fileFullPath];
|
auto fileURL = (CFURLRef)[[NSURL alloc] initFileURLWithPath:fileFullPath];
|
||||||
[fileFullPath release];
|
[fileFullPath release];
|
||||||
|
|
||||||
|
|
|
@ -145,7 +145,7 @@ void AudioPlayer::rotateBufferThread(int offsetFrame)
|
||||||
ALint bufferProcessed = 0;
|
ALint bufferProcessed = 0;
|
||||||
ExtAudioFileRef extRef = nullptr;
|
ExtAudioFileRef extRef = nullptr;
|
||||||
|
|
||||||
NSString *fileFullPath = [[NSString alloc] initWithCString:_audioCache->_fileFullPath.c_str() encoding:[NSString defaultCStringEncoding]];
|
NSString *fileFullPath = [[NSString alloc] initWithCString:_audioCache->_fileFullPath.c_str() encoding:NSUTF8StringEncoding];
|
||||||
auto fileURL = (CFURLRef)[[NSURL alloc] initFileURLWithPath:fileFullPath];
|
auto fileURL = (CFURLRef)[[NSURL alloc] initFileURLWithPath:fileFullPath];
|
||||||
[fileFullPath release];
|
[fileFullPath release];
|
||||||
char* tmpBuffer = (char*)malloc(_audioCache->_queBufferBytes);
|
char* tmpBuffer = (char*)malloc(_audioCache->_queBufferBytes);
|
||||||
|
|
Loading…
Reference in New Issue