Как определить завершение AVSpeechSynthesizer.write?IOS

Программируем под IOS
Ответить
Гость
 Как определить завершение AVSpeechSynthesizer.write?

Сообщение Гость »


On IOS, Apple's AVSpeechSynthesizer offer's a write function, as an alternative to the speak() function, which gives you the speech as data (presumably to write the speech output to a file) instead of feeding it to audio.

It doesn't actually write the file itself, but provides a callback that gives you a series of buffers -- segments of the total audio data. These buffers arrive as "AVAudioBuffer" instances. These are (presumably due to no authoritative reference) an abstract type with an unpredictable "actual?" type... and of non-standardized/arbitrary/unpredictable length and format...

... like this:

Код: Выделить всё

[your AVSpeechSynthesizer instance].write(utterance) { buffer in       // buffers are repeatedly sent to this callback rapidly >>> in segments, not as a whole 

Источник: [url]https://stackoverflow.com/questions/78131734/how-to-detect-when-avspeechsynthesizer-write-is-finished[/url]
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «IOS»