public boolean resetStream( AudioFormat format )
    {
        // make sure the Mixer exists:
        if( errorCheck( myMixer == null,
                        "Mixer null in method 'resetStream'" ) )
            return false;
        
        // make sure a format was specified:
        if( errorCheck( format == null,
                        "AudioFormat null in method 'resetStream'" ) )
            return false;
        
        DataLine.Info lineInfo;
        lineInfo = new DataLine.Info( SourceDataLine.class, format );
        if( errorCheck( !AudioSystem.isLineSupported( lineInfo ), 
                        "Line not supported in method 'resetStream'" ) )
            return false;
        
        SourceDataLine newSourceDataLine = null;
        try
        {
            newSourceDataLine = (SourceDataLine) myMixer.getLine( lineInfo );
        }
        catch( Exception e )
        {
            errorMessage( "Unable to create a SourceDataLine " +
                          "in method 'resetStream'" );
            printStackTrace( e );
            return false;
        }
        
        if( errorCheck( newSourceDataLine == null,
                        "New SourceDataLine null in method 'resetStream'" ) )
            return false;
        
        streamBuffers.clear();
        processed = 0;
        
        // if there was already something playing on this channel, remove it:
        if( sourceDataLine != null )
        {
            sourceDataLine.stop();
            sourceDataLine.flush();
            sourceDataLine.close();
        }
        
        // Update the clip and format varriables:
        sourceDataLine = newSourceDataLine;  
        myFormat = format;
        newSourceDataLine = null;
        
        try
        {
            sourceDataLine.open( myFormat );
        }
        catch( Exception e )
        {
            errorMessage( "Unable to open the new SourceDataLine in method " +
                          "'resetStream'" );
            printStackTrace( e );
            return false;
        }
        
        resetControls();
        
        // Success:
        return true;
    }