Class LuteceWordToSound
- java.lang.Object
-
- com.octo.captcha.component.sound.wordtosound.AbstractWordToSound
-
- 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
-
-
Constructor Summary
Constructors Constructor Description LuteceWordToSound(com.octo.captcha.component.sound.soundconfigurator.SoundConfigurator configurator, int minAcceptedWordLength, int maxAcceptedWordLength, int minWhiteSoundNumber, int maxWhiteSoundNumber, LuteceBackgroundSoundMixerConfigurator mixerConfigurator, SoundFilter... filters)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetMaxAcceptedWordLenght()intgetMaxAcceptedWordLength()intgetMinAcceptedWordLenght()intgetMinAcceptedWordLength()javax.sound.sampled.AudioInputStreamgetSound(java.lang.String word)javax.sound.sampled.AudioInputStreamgetSound(java.lang.String word, java.util.Locale locale)static floatgetSoundsSampleRate()Static method to get used sounds sample rate
-
-
-
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 configuratorminAcceptedWordLength- the min Accepted Word LengthmaxAcceptedWordLength- the max Accepted Word LengthminWhiteSoundNumber- the min White Sound NumbermaxWhiteSoundNumber- the max White Sound NumbermixerConfigurator- the mixer Configuratorfilters- the filters
-
-
Method Detail
-
getSound
public javax.sound.sampled.AudioInputStream getSound(java.lang.String word)
- Parameters:
word- the word- Returns:
- the audio input stream
-
getSound
public javax.sound.sampled.AudioInputStream getSound(java.lang.String word, java.util.Locale locale)- Parameters:
word- the wordlocale- the locale- Returns:
- the audio input stream
-
getMaxAcceptedWordLenght
public int getMaxAcceptedWordLenght()
- Specified by:
getMaxAcceptedWordLenghtin interfacecom.octo.captcha.component.sound.wordtosound.WordToSound- Overrides:
getMaxAcceptedWordLenghtin classcom.octo.captcha.component.sound.wordtosound.AbstractWordToSound- Returns:
- the Max Accepted Word Lenght
-
getMaxAcceptedWordLength
public int getMaxAcceptedWordLength()
- Specified by:
getMaxAcceptedWordLengthin interfacecom.octo.captcha.component.sound.wordtosound.WordToSound- Overrides:
getMaxAcceptedWordLengthin classcom.octo.captcha.component.sound.wordtosound.AbstractWordToSound- Returns:
- the Max Accepted Word Length
-
getMinAcceptedWordLenght
public int getMinAcceptedWordLenght()
- Specified by:
getMinAcceptedWordLenghtin interfacecom.octo.captcha.component.sound.wordtosound.WordToSound- Overrides:
getMinAcceptedWordLenghtin classcom.octo.captcha.component.sound.wordtosound.AbstractWordToSound- Returns:
- the Min Accepted Word Lenght
-
getMinAcceptedWordLength
public int getMinAcceptedWordLength()
- Specified by:
getMinAcceptedWordLengthin interfacecom.octo.captcha.component.sound.wordtosound.WordToSound- Overrides:
getMinAcceptedWordLengthin classcom.octo.captcha.component.sound.wordtosound.AbstractWordToSound- Returns:
- the Min Accepted Word Length
-
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
-
-