filoe / cscore

An advanced audio library, written in C#. Provides tons of features. From playing/recording audio to decoding/encoding audio streams/files to processing audio data in realtime (e.g. applying custom effects during playback, create visualizations,...). The possibilities are nearly unlimited.
Other
2.14k stars 450 forks source link

[Question] Getting playback position with WriteableBufferingSource ? #479

Open lzanoni-stm opened 1 year ago

lzanoni-stm commented 1 year ago

Hello,

I'm sending buffers generated by speech-synthesis, using WriteableBufferingSource, then NotiticationSource and finally WaveOut. When I get the event from the NotificationSource, the Position of the WriteableBufferingSource is always 0. After looking in CSCore, it seems it's on purpose.

What could be a workaround to get an approximation (~100ms) of the current playback position ? Is there an alternate to WriteableBufferingSource accepting buffers and giving the Read position ?

Any hint appreciated

filoe commented 1 year ago

You could write some kind of counting source which just reads from a base source and incremenrs its position by the number of read samples or bytes.Am 20.02.2023 um 12:30 schrieb lzanoni-stm @.***>: Hello, I'm sending buffers generated by speech-synthesis, using WriteableBufferingSource, then NotiticationSource and finally WaveOut. When I get the event from the NotificationSource, the Position of the WriteableBufferingSource is always 0. After looking in CSCore, it seems it's on purpose. What could be a workaround to get an approximation (~100ms) of the current playback position ? Is there an alternate to WriteableBufferingSource accepting buffers and giving the Read position ? Any hint appreciated

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>