• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

playing ogg voices as smooth as possible in java TTS

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello guys
Am developing a text-to-speech for my own language in java (its my final project which is not developed before, therefor I could NOT use built-in classes). I can recognize the diphones for input text, for playing: I place the diphones in an array, after the input text analysis completed I play the audio files (which are in ogg format) according to the diphones in the array one by one. what I want to ask is: what do you think about this way for playing separate diphones? and what to do to make it smoother because its really not smooth (there is a big gap between playing one file and next one)
 
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, welcome to CodeRanch!

Please UseRealWords. I imagine not many people know what the abbreviation TTS stands for, so it's better to just write text-to-speech.

As for your problem, I haven't really worked with audio in Java that much, but I imagine that instead of playing separate files, it's better to buffer the files well before they're about to be played, or create an entire new file consisting of the phones and diphones for the part of speech that you want to play.
 
Nawras Nzar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for reply...
I don't think it's possible to merge all files, but buffering them well maybe.
but I'm seeking for better approach
thank you again.
 
Stephan van Hulst
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A better approach than buffering? What's wrong with buffering?
 
Nawras Nzar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry I didn't mean it's not good
but I personally didn't tried it before so I don't know how much effective it will be.
my audio files are in a package for example sounds and I just give the path and play
better say I don't know how exactly to buffer them!!!
 
Stephan van Hulst
Saloon Keeper
Posts: 15510
363
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Exactly, that's the problem. You're loading the files one at a time, so there's a gap between two fragments when the program has to load the next file. If the sounds are buffered, they can start playing immediately after the previous sound ends.

Now, if you show us how you're currently playing the sound fragments, maybe we can show you how to improve smooth playback.
 
Nawras Nzar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


if I remove line.drain(); it become very much faster, but I don't know if any drawbacks I will face
 
Stephan van Hulst
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is very little to go on. I don't know how you're loading files, how you're handling your fragment queuing, what types you're using, etc.

Please post an SSCCE.
 
Nawras Nzar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
from this class tokens send to Sound.java class

Speech.java



this is Sound.java

 
Nawras Nzar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mr.Stephan van Hulst are you there?
I really need help...
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic