fr.paris.lutece.plugins.captcha.modules.jcaptcha.service.sound
Class LuteceWordToSound

java.lang.Object
  extended by com.octo.captcha.component.sound.wordtosound.AbstractWordToSound
      extended by fr.paris.lutece.plugins.captcha.modules.jcaptcha.service.sound.LuteceWordToSound
All Implemented Interfaces:
com.octo.captcha.component.sound.wordtosound.WordToSound

public class LuteceWordToSound
extends com.octo.captcha.component.sound.wordtosound.AbstractWordToSound


Field Summary
 
Fields inherited from class com.octo.captcha.component.sound.wordtosound.AbstractWordToSound
configurator, maxAcceptedWordLength, minAcceptedWordLength
 
Constructor Summary
LuteceWordToSound(com.octo.captcha.component.sound.soundconfigurator.SoundConfigurator configurator, int minAcceptedWordLength, int maxAcceptedWordLength, int minWhiteSoundNumber, int maxWhiteSoundNumber, LuteceBackgroundSoundMixerConfigurator mixerConfigurator, SoundFilter... filters)
           
 
Method Summary
protected  AudioInputStream addEffects(AudioInputStream inputStream)
           
 int getMaxAcceptedWordLenght()
           
 int getMaxAcceptedWordLength()
           
 int getMinAcceptedWordLenght()
           
 int getMinAcceptedWordLength()
           
 AudioInputStream getSound(String word)
           
 AudioInputStream getSound(String word, Locale locale)
           
static float getSoundsSampleRate()
          Static method to get used sounds sample rate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuteceWordToSound

public LuteceWordToSound(com.octo.captcha.component.sound.soundconfigurator.SoundConfigurator configurator,
                         int minAcceptedWordLength,
                         int maxAcceptedWordLength,
                         int minWhiteSoundNumber,
                         int maxWhiteSoundNumber,
                         LuteceBackgroundSoundMixerConfigurator mixerConfigurator,
                         SoundFilter... filters)
Parameters:
configurator - the configurator
minAcceptedWordLength - the min Accepted Word Length
maxAcceptedWordLength - the max Accepted Word Length
minWhiteSoundNumber - the min White Sound Number
maxWhiteSoundNumber - the max White Sound Number
mixerConfigurator - the mixer Configurator
filters - the filters
Method Detail

getSound

public AudioInputStream getSound(String word)
Parameters:
word - the word
Returns:
the audio input stream

getSound

public AudioInputStream getSound(String word,
                                 Locale locale)
Parameters:
word - the word
locale - the locale
Returns:
the audio input stream

getMaxAcceptedWordLenght

public int getMaxAcceptedWordLenght()
Specified by:
getMaxAcceptedWordLenght in interface com.octo.captcha.component.sound.wordtosound.WordToSound
Overrides:
getMaxAcceptedWordLenght in class com.octo.captcha.component.sound.wordtosound.AbstractWordToSound
Returns:
the Max Accepted Word Lenght

getMaxAcceptedWordLength

public int getMaxAcceptedWordLength()
Specified by:
getMaxAcceptedWordLength in interface com.octo.captcha.component.sound.wordtosound.WordToSound
Overrides:
getMaxAcceptedWordLength in class com.octo.captcha.component.sound.wordtosound.AbstractWordToSound
Returns:
the Max Accepted Word Length

getMinAcceptedWordLenght

public int getMinAcceptedWordLenght()
Specified by:
getMinAcceptedWordLenght in interface com.octo.captcha.component.sound.wordtosound.WordToSound
Overrides:
getMinAcceptedWordLenght in class com.octo.captcha.component.sound.wordtosound.AbstractWordToSound
Returns:
the Min Accepted Word Lenght

getMinAcceptedWordLength

public int getMinAcceptedWordLength()
Specified by:
getMinAcceptedWordLength in interface com.octo.captcha.component.sound.wordtosound.WordToSound
Overrides:
getMinAcceptedWordLength in class com.octo.captcha.component.sound.wordtosound.AbstractWordToSound
Returns:
the Min Accepted Word Length

addEffects

protected AudioInputStream addEffects(AudioInputStream inputStream)
Specified by:
addEffects in class com.octo.captcha.component.sound.wordtosound.AbstractWordToSound
Parameters:
inputStream - the input Stream
Returns:
audio input stream

getSoundsSampleRate

public static float getSoundsSampleRate()
Static method to get used sounds sample rate

Returns:
used sounds sample rate or default value (22050 Hz) if there is problem during analysis


Copyright © 2014 Mairie de Paris. All Rights Reserved.