mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 11:12:44 +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 {
|
for {
|
||||||
if osstatus := C.AudioQueueStart(p.audioQueue, nil); osstatus != C.noErr {
|
if osstatus := C.AudioQueuePrime(p.audioQueue, 0, nil); osstatus != C.noErr {
|
||||||
// AudioQueueStart might fail just after recovering from Siri.
|
// AudioQueuePrime might fail just after recovering from Siri.
|
||||||
if osstatus == C.AVAudioSessionErrorCodeSiriIsRecording {
|
if osstatus == C.AVAudioSessionErrorCodeSiriIsRecording {
|
||||||
time.Sleep(10 * time.Millisecond)
|
time.Sleep(10 * time.Millisecond)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
p.setErrorImpl(fmt.Errorf("readerdriver: AudioQueueStart failed: %d", osstatus))
|
p.setErrorImpl(fmt.Errorf("readerdriver: AudioQueuePrime failed: %d", osstatus))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
break
|
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.state = playerPlay
|
||||||
p.cond.Signal()
|
p.cond.Signal()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user