public class BaseUnitConcatenator extends Object implements UnitConcatenator
Modifier and Type | Class and Description |
---|---|
static class |
BaseUnitConcatenator.UnitData |
Modifier and Type | Field and Description |
---|---|
protected AudioFormat |
audioformat |
protected UnitDatabase |
database |
protected org.apache.log4j.Logger |
logger |
protected ProsodyAnalyzer |
prosodyAnalyzer |
protected TimelineReader |
timeline |
protected double |
unitToTimelineSampleRateFactor |
Constructor and Description |
---|
BaseUnitConcatenator()
Empty Constructor; need to call load(UnitDatabase) separately
|
Modifier and Type | Method and Description |
---|---|
protected Datagram |
createZeroDatagram(int length)
Create a datagram appropriate for this unit concatenator which contains only zero values as samples.
|
protected void |
determineTargetPitchmarks(List<SelectedUnit> units)
Determine target pitchmarks (= duration and f0) for each unit.
|
protected AudioInputStream |
generateAudioStream(List<SelectedUnit> units)
Generate audio to match the target pitchmarks as closely as possible.
|
AudioInputStream |
getAudio(List<SelectedUnit> units)
Build the audio stream from the units
|
AudioFormat |
getAudioFormat()
Provide the audio format which will be produced by this unit concatenator.
|
protected void |
getDatagramsFromTimeline(List<SelectedUnit> units)
Get the raw audio material for each unit from the timeline.
|
void |
load(UnitDatabase unitDatabase)
Initialise the unit concatenator from the database.
|
protected int |
unitToTimeline(int duration) |
protected long |
unitToTimeline(long time) |
protected org.apache.log4j.Logger logger
protected UnitDatabase database
protected TimelineReader timeline
protected AudioFormat audioformat
protected double unitToTimelineSampleRateFactor
protected ProsodyAnalyzer prosodyAnalyzer
public BaseUnitConcatenator()
load(UnitDatabase)
public void load(UnitDatabase unitDatabase)
UnitConcatenator
load
in interface UnitConcatenator
unitDatabase
- databasepublic AudioFormat getAudioFormat()
getAudioFormat
in interface UnitConcatenator
public AudioInputStream getAudio(List<SelectedUnit> units) throws IOException
getAudio
in interface UnitConcatenator
units
- the unitsIOException
- IOExceptionprotected void getDatagramsFromTimeline(List<SelectedUnit> units) throws IOException
units
- unitsIOException
- IOExceptionprotected void determineTargetPitchmarks(List<SelectedUnit> units)
units
- unitsprotected AudioInputStream generateAudioStream(List<SelectedUnit> units) throws IOException
units
- unitsIOException
- IOExceptionprotected Datagram createZeroDatagram(int length)
length
- the number of zeros that the datagram should containprotected int unitToTimeline(int duration)
protected long unitToTimeline(long time)
Copyright © 2000–2016 DFKI GmbH. All rights reserved.