public boolean attachBuffer( IntBuffer buf )
    {
        // A sound buffer can only be attached to a normal source:
        if( errorCheck( channelType != SoundSystemConfig.TYPE_NORMAL,
                        "Sound buffers may only be attached to normal " +
                        "sources." ) )
            return false;
        
        // send the sound buffer to the channel:
        AL10.alSourcei( ALSource.get( 0 ), AL10.AL_BUFFER,
                        buf.get(0) );


        // save the format for later, for determining milliseconds played
        if( attachedSource != null && attachedSource.soundBuffer != null &&
            attachedSource.soundBuffer.audioFormat != null )
            setAudioFormat( attachedSource.soundBuffer.audioFormat );

        // Check for errors and return:
        return checkALError();
    }