nl.captcha.audio.producer
Class RandomNumberVoiceProducer

java.lang.Object
  extended by nl.captcha.audio.producer.RandomNumberVoiceProducer
All Implemented Interfaces:
VoiceProducer

public class RandomNumberVoiceProducer
extends java.lang.Object
implements VoiceProducer

VoiceProducer which generates a vocalization for a given number, randomly selecting from a list of voices. The default voices are located in the jar in the sounds/en/numbers directory, and have filenames with a format of num-voice.wav, e.g.: sounds/en/numbers/1-alex.wav.

Author:
James Childers

Constructor Summary
RandomNumberVoiceProducer()
           
RandomNumberVoiceProducer(java.util.Map<java.lang.Integer,java.lang.String[]> voices)
          Creates a RandomNumberVoiceProducer for the given voices, a map of numbers to their corresponding filenames.
 
Method Summary
 Sample getVocalization(char num)
           
 java.util.Map<java.lang.Integer,java.lang.String[]> getVoices()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomNumberVoiceProducer

public RandomNumberVoiceProducer()

RandomNumberVoiceProducer

public RandomNumberVoiceProducer(java.util.Map<java.lang.Integer,java.lang.String[]> voices)
Creates a RandomNumberVoiceProducer for the given voices, a map of numbers to their corresponding filenames. Conceptually the map must look like the following:
 {1 => ["/my_sounds/1-quiet.wav", "/my_sounds/1-loud.wav"],
  2 => ["/my_sounds/2-quiet.wav", "/my_sounds/2-loud.wav"]}
 

Parameters:
voices -
Method Detail

getVoices

public java.util.Map<java.lang.Integer,java.lang.String[]> getVoices()

getVocalization

public final Sample getVocalization(char num)
Specified by:
getVocalization in interface VoiceProducer


Copyright © 2010-2011 James Childers. All Rights Reserved.