Package de.sciss.io

Examples of de.sciss.io.AudioFileDescr


 

  public static AudioTrail newFrom( AudioFile af )
  throws IOException
  {
    final AudioFileDescr  afd      = af.getDescr();
    final int[][]      channelMaps = new int[ 1 ][ afd.channels ];
    final AudioTrail    at;
    final Span        span    = new Span( 0, afd.length );

    for( int i = 0; i < afd.channels; i++ ) {
View Full Code Here


    if( afs.length == 1 ) return newFrom( afs[ 0 ]);
    if( afs.length == 0 ) throw new IllegalArgumentException( "Need at least one audio file" );
   
    final long      length;
    final double    rate;
    AudioFileDescr    afd;
    final int[][]    channelMaps;
    final Span      span;
    final AudioTrail  at;
    final Span[]    fileSpans  = new Span[ afs.length ];
   
View Full Code Here

  public void exchange( AudioFile af )
  throws IOException
  {
    if( audioFiles.length != 1 ) throw new IllegalStateException();
 
    final AudioFileDescr  afd      = af.getDescr();
    final Span        span    = new Span( 0, afd.length );

    if( afd.channels != channelMaps[ 0 ].length ) throw new IllegalStateException();

//    clear( null );
View Full Code Here

    if( audioFiles.length != afs.length ) throw new IllegalStateException();
   
    final long      length;
    final double    rate;
    AudioFileDescr    afd;
    final Span      span;
    final Span[]    fileSpans  = new Span[ afs.length ];
   
    afd      = afs[ 0 ].getDescr();
    length    = afd.length;
View Full Code Here

//    }
   
   private void createTempFiles()
    throws IOException
  {
    final AudioFileDescr afd  = new AudioFileDescr();
    afd.type          = AudioFileDescr.TYPE_WAVE64; // TYPE_AIFF
    afd.rate          = getRate();
    afd.bitsPerSample      = 32;
    afd.sampleFormat      = AudioFileDescr.FORMAT_FLOAT;

    if( singleFile ) {
      afd.channels      = getChannelNum();
      afd.file        = IOUtil.createTempFile();
      tempF          = new AudioFile[] { AudioFile.openAsWrite( afd )};
    } else {
      AudioFileDescr afd2;
      final AudioFile[] tempF2 = new AudioFile[ channelMaps.length ];
      for( int i = 0; i < channelMaps.length; i++ ) {
        afd2        = new AudioFileDescr( afd );
        afd2.channels    = channelMaps[ i ].length;
        afd2.file      = IOUtil.createTempFile();
        tempF2[ i ]      = AudioFile.openAsWrite( afd2 );
      }
      // real assignment here coz tempF will remain null if error occurs in the loop
View Full Code Here

  {
    super();
 
    this.afds          = afds;
    if( displayAFD == null ) {
      this.displayAFD      = new AudioFileDescr();
      autoCreateDisplayDescr();
    } else {
      this.displayAFD      = displayAFD;
      name          = displayAFD.file == null ? null : displayAFD.file.getName();
    }
View Full Code Here

  {
    if( afds.length == 0 ) {
      displayAFD.file        = null;
      name            = null;
    } else {
      final AudioFileDescr proto  = afds[ 0 ];
      displayAFD.type        = proto.type;
      displayAFD.rate        = proto.rate;
      displayAFD.bitsPerSample  = proto.bitsPerSample;
      displayAFD.sampleFormat    = proto.sampleFormat;
      displayAFD.length      = proto.length;
View Full Code Here

  public static Session newFrom( File path, boolean createTransport, boolean createOSC )
  throws IOException
  {
    final AudioFile      af  = AudioFile.openAsRead( path );
    final AudioFileDescr  afd  = af.getDescr();
    Session          doc  = null;
    AudioTrail        at  = null;
   
    try {
// System.err.println( "readMarkers" );
View Full Code Here

      final int[]            channelMap  = (int[]) context.getClientArg( "chanMap" );
      final AudioTrail        audioTrail  = doc.getAudioTrail();
//      final File[]          tempFs    = new File[ numFiles ];
//      final boolean[]          renamed    = new boolean[ numFiles ];
      final AudioFile[]        afs      = new AudioFile[ numFiles ];
      AudioFileDescr          afdTemp;
      File              tempF;
     
      context.putClientArg( "afs", afs );

      if( saveMarkers ) {
        if( clientAFDs[ 0 ].isPropertySupported( AudioFileDescr.KEY_MARKERS )) {
          doc.markers.copyToAudioFile( clientAFDs[ 0 ], span )// XXX
        } else if( !doc.markers.isEmpty() ) {
          System.err.println( "WARNING: markers are not saved in this file format!!!" );
        }
      } else { // WARNING: we must clear KEY_MARKERS, it might contain copied data!
        clientAFDs[ 0 ].setProperty( AudioFileDescr.KEY_MARKERS, null );
      }
      for( int i = 0; i < numFiles; i++ ) {
        if( clientAFDs[ i ].file.exists() ) {
//            tempFs[ i ]      = File.createTempFile( "eis", null, afds[ i ].file.getParentFile() );
//            tempFs[ i ].delete();
          tempF        = File.createTempFile( "eis", null, clientAFDs[ i ].file.getParentFile() );
          afdTemp        = new AudioFileDescr( clientAFDs[ i ]);
//            afdTemp.file    = tempFs[ i ];
          afdTemp.file    = tempF;
//            renamed[ i ]    = true;
          afs[ i ]      = AudioFile.openAsWrite( afdTemp );
        } else {
View Full Code Here

      super( text, shortcut );
    }

    public void actionPerformed( ActionEvent e )
    {
      final AudioFileDescr afd = query();
      if( afd != null ) {
//        // XXX there is a bug with
//        // FloatingPaletteHandler
//        // causing infinite mutual window
//        // refresh if we open the new window
View Full Code Here

TOP

Related Classes of de.sciss.io.AudioFileDescr

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.