festvox / speech_tools

Edinburgh Speech Tools
Other
56 stars 25 forks source link

Does `int n` in `EST_Wave.copy_sample` select channel? #50

Closed guygastineau closed 2 years ago

guygastineau commented 2 years ago

https://github.com/festvox/speech_tools/blob/9208f35ac1a8cd32c949b069c3ef073364f18a8b/include/EST_Wave.h#L221

I am finishing up some haskell bindings to the wonderful festival project. I include text to wave, and thus I am binding to the EST_Wave header as well. I see the formal int n of the method copy_sample specifies the row to copy from the underlying matrix type, but I don't know what that means for the sample. Is this just an index for channels in the EST_Wave? Thank you for your time.

lenzo-ka commented 2 years ago

I believe by default ch_wave and other utilities take the first channel and treat it as mono. Also, it doesn't handle 24 bit data.

guygastineau commented 2 years ago

Okay, so I should just pass 0 for n to get the first (only) channel? I am doing it that way now and it works. I just felt a little uneasy about it given such a short name, n, and no comments. I appreciate your fast response to my issue :)

lenzo-ka commented 2 years ago

I think that is the safest. In general it is best to preprocess any multichannel data to mono, but when EST_Wave knows about channels it can at least select one. Without loss of generality it should be ok to take channel 0 in the absence of other information.

guygastineau commented 2 years ago

Thank you @lenzo-duo !

Let me know if the following questions about async mode should be in another issue.

I do have one more question about the async mode getting triggered as mentioned here. The example main at the end of that sections states that festival_say_file puts the system in async mode necessitating a call to festival_wait_for_spooler. I hope to avoid async mode, so I am not including the say from file function. Is there a list of functions that trigger async mode? Can async mode be triggered by the Scheme API?

guygastineau commented 2 years ago

As my last question is really about festival I have raised a new issue, and I will close this one.