mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
audio/internal/readerdriver: Use AudioQueuePrime
This commit is contained in:
parent
6644e43025
commit
a285a84df0
@ -366,18 +366,23 @@ func (p *playerImpl) Play() {
|
||||
}
|
||||
|
||||
for {
|
||||
if osstatus := C.AudioQueueStart(p.audioQueue, nil); osstatus != C.noErr {
|
||||
// AudioQueueStart might fail just after recovering from Siri.
|
||||
if osstatus := C.AudioQueuePrime(p.audioQueue, 0, nil); osstatus != C.noErr {
|
||||
// AudioQueuePrime might fail just after recovering from Siri.
|
||||
if osstatus == C.AVAudioSessionErrorCodeSiriIsRecording {
|
||||
time.Sleep(10 * time.Millisecond)
|
||||
continue
|
||||
}
|
||||
p.setErrorImpl(fmt.Errorf("readerdriver: AudioQueueStart failed: %d", osstatus))
|
||||
p.setErrorImpl(fmt.Errorf("readerdriver: AudioQueuePrime failed: %d", osstatus))
|
||||
return
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
if osstatus := C.AudioQueueStart(p.audioQueue, nil); osstatus != C.noErr {
|
||||
p.setErrorImpl(fmt.Errorf("readerdriver: AudioQueueStart failed: %d", osstatus))
|
||||
return
|
||||
}
|
||||
|
||||
p.state = playerPlay
|
||||
p.cond.Signal()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user