VeriSpeak SDK, NVoice: how to get audio length in seconds?

General information about Neurotechnology and its software

VeriSpeak SDK, NVoice: how to get audio length in seconds?

Postby topo » Feb 22, 2017 13:05

Hi,

After initializing NVoice from audio file
Code: Select all
NVoice voice = new NVoice() { FileName = filename, PhraseId = phrase_id, };

is it possible to get the audio length in seconds?

Kind regards
Dmitry
topo
 
Posts: 11
Joined: Feb 19, 2017 10:34

Re: VeriSpeak SDK, NVoice: how to get audio length in second

Postby MartynasV » Feb 23, 2017 10:37

topo wrote:Hi,

After initializing NVoice from audio file
Code: Select all
NVoice voice = new NVoice() { FileName = filename, PhraseId = phrase_id, };

is it possible to get the audio length in seconds?

Kind regards
Dmitry

Hello,

You can get length of recording using NMediaReader:
Code: Select all
var reader = new NMediaReader(@"PATH/filename.mp3", NMediaType.Audio, false);
Console.WriteLine("Length: {0}", reader.Length);
Martynas V
Neurotechnology
MartynasV
Neurotechnology
 
Posts: 259
Joined: Feb 27, 2015 11:24
Location: Vilnius, Lithuania

Re: VeriSpeak SDK, NVoice: how to get audio length in second

Postby topo » Feb 23, 2017 20:00

Thanks!!
topo
 
Posts: 11
Joined: Feb 19, 2017 10:34


Return to Public

Who is online

Users browsing this forum: No registered users and 1 guest