src/main/java/ca/phon/plugins/praat/export/TextGridExporter.java
/**
	 * Create an empty textgrid from the given record.
	 * Initializes the TextGrid with proper min/max times
	 *
	 * @param utt
	 */
Create an empty textgrid from the given record.
Initializes the TextGrid with proper min/max times

@param utt
Create an empty textgrid from the given record . Initializes the TextGrid with proper min / max times @param utt
public TextGrid createEmptyTextGrid(Record utt) {
		double startTime = Integer.MAX_VALUE, endTime = Integer.MIN_VALUE;
		final Tier<MediaSegment> segmentTier = utt.getSegment();
		if(segmentTier.numberOfGroups() == 0) return null;
		final MediaSegment media = segmentTier.getGroup(0);
		if(media != null) {
			double st = media.getStartValue();
			if(media.getUnitType() == MediaUnit.Millisecond)
				st /= 1000.0f;
			double et = media.getEndValue();
			if(media.getUnitType() == MediaUnit.Millisecond)
				et /= 1000.0f;
			startTime = Math.min(startTime, st);
			endTime = Math.max(endTime, et);
		}
		try {
			return TextGrid.createWithoutTiers(startTime, endTime);
		} catch (PraatException e) {
			LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e);
			return null;
		}
	}
public TextGrid createEmptyTextGrid ( Record utt ) { double startTime = Integer . MAX_VALUE , endTime = Integer . MIN_VALUE ; final Tier < MediaSegment > segmentTier = utt . getSegment ( ) ; if ( segmentTier . numberOfGroups ( ) == 0 ) return null ; final MediaSegment media = segmentTier . getGroup ( 0 ) ; if ( media != null ) { double st = media . getStartValue ( ) ; if ( media . getUnitType ( ) == MediaUnit . Millisecond ) st /= 1000.0f ; double et = media . getEndValue ( ) ; if ( media . getUnitType ( ) == MediaUnit . Millisecond ) et /= 1000.0f ; startTime = Math . min ( startTime , st ) ; endTime = Math . max ( endTime , et ) ; } try { return TextGrid . createWithoutTiers ( startTime , endTime ) ; } catch ( PraatException e ) { LOGGER . log ( Level . SEVERE , e . getLocalizedMessage ( ) , e ) ; return null ; } }
Create an empty textgrid from the given record.
Create an empty textgrid from the given record .