rem: stream->b16 = b16;
add: stream->bitsPerSample = bitsPerSample;
context: echo_stream_set_audioparms(echo_stream *stream, uint8 channels,     uint8 b16, uint32 sample_rate){	int32 			i;	uint8 			sample_size, frame_size;	ECHOGALS_OPENAUDIOPARAMETERS	open_params;	ECHOGALS_CLOSEAUDIOPARAMETERS  close_params;	ECHOGALS_AUDIOFORMAT			format_params;	ECHOSTATUS status;		LOG(("echo_stream_set_audioparms\n"));		close_params.wPipeIndex = stream->pipe;		status = stream->card->pEG->CloseAudio(&close_params);	if(status!=ECHOSTATUS_OK && status!=ECHOSTATUS_CHANNEL_NOT_OPEN) {		PRINT(("echo_stream_set_audioparms : CloseAudio failed\n"));		PRINT(("  status: %s \n", pStatusStrs[status]));		return B_ERROR;	}		open_params.bIsCyclic = TRUE;	open_params.Pipe.nPipe = 0;	open_params.Pipe.bIsInput = stream->use == ECHO_USE_RECORD ? TRUE : FALSE;	open_params.Pipe.wInterleave = stream->channels;		status = stream->card->pEG->OpenAudio(&open_params, &stream->pipe);	if(status!=ECHOSTATUS_OK) {		PRINT(("echo_stream_set_audioparms : OpenAudio failed\n"));		PRINT(("  status: %s \n", pStatusStrs[status]));		return B_ERROR;	}	status = stream->card->pEG->VerifyAudioOpen(stream->pipe);	if(status!=ECHOSTATUS_OK) {		PRINT(("echo_stream_set_audioparms : VerifyAudioOpen failed\n"));		PRINT(("  status: %s \n", pStatusStrs[status]));		return B_ERROR;	}		if ((stream->channels == channels) &&		(stream->b16 == b16) && 		(stream->sample_rate == sample_rate))		return B_OK;	format_params.wBitsPerSample = b16 == 0 ? 8 : 16;	format_params.byDataAreBigEndian = 0;	format_params.byMonoToStereo = 0;	format_params.wDataInterleave = channels == 1 ? 1 : 2;	status = stream->card->pEG->QueryAudioFormat(stream->pipe, &format_params);	if(status!=ECHOSTATUS_OK) {		PRINT(("echo_stream_set_audioparms : bad format when querying\n"));		PRINT(("  status: %s \n", pStatusStrs[status]));		return B_ERROR;	}		/* XXXX : setting sample rate is global in this driver */	status = stream->card->pEG->QueryAudioSampleRate(sample_rate);	if(status!=ECHOSTATUS_OK) {		PRINT(("echo_stream_set_audioparms : bad sample rate when querying\n"));		PRINT(("  status: %s \n", pStatusStrs[status]));		return B_ERROR;	}			status = stream->card->pEG->SetAudioFormat(stream->pipe, &format_params);	if(status!=ECHOSTATUS_OK) {		PRINT(("echo_stream_set_audioparms : bad format when setting\n"));		PRINT(("  status: %s \n", pStatusStrs[status]));		return B_ERROR;	}		/* XXXX : setting sample rate is global in this driver */	status = stream->card->pEG->SetAudioSampleRate(sample_rate);	if(status!=ECHOSTATUS_OK) {		PRINT(("echo_stream_set_audioparms : bad sample rate when setting\n"));		PRINT(("  status: %s \n", pStatusStrs[status]));		return B_ERROR;	}		if(stream->buffer)		echo_mem_free(stream->card, stream->buffer->log_base);			stream->b16 = b16;	stream->sample_rate = sample_rate;	stream->channels = channels;		sample_size = stream->b16 + 1;	frame_size = sample_size * stream->channels;		stream->buffer = echo_mem_alloc(stream->card, stream->bufframes * frame_size * stream->bufcount);		stream->trigblk = 0;	/* This shouldn't be needed */	stream->blkmod = stream->bufcount;	stream->blksize = stream->bufframes * frame_size;		CDaffyDuck *duck = stream->card->pEG->GetDaffyDuck(stream->pipe);	if(duck == NULL) {		PRINT(("echo_stream_set_audioparms : Could not get daffy duck pointer\n"));		return B_ERROR;	}		uint32 dwNumFreeEntries = 0;	for(i=0; i<stream->bufcount; i++) {		duck->AddMapping(((uint32)stream->buffer->phy_base) + 			i * stream->blksize, stream->blksize, 0, TRUE, dwNumFreeEntries);	}		duck->Wrap();		if(stream->card->pEG->GetAudioPositionPtr(stream->pipe, stream->position)!=ECHOSTATUS_OK) {		PRINT(("echo_stream_set_audioparms : Could not get audio position ptr\n"));		return B_ERROR;	}		return B_OK;}