index.js
function fromObject (obj) {
	//else retrieve format properties from object
	var format = {}

	formatProperties.forEach(function (key) {
		if (obj[key] != null) format[key] = obj[key]
	})

	//some AudioNode/etc-specific options
	if (!format.channels && (obj.channelCount || obj.numberOfChannels)) {
		format.channels = obj.channelCount || obj.numberOfChannels
	}
	if (!format.sampleRate && obj.rate) {
		format.sampleRate = obj.rate
	}

	return format
}
function fromObject (obj) {
	//else retrieve format properties from object
	var format = {}

	formatProperties.forEach(function (key) {
		if (obj[key] != null) format[key] = obj[key]
	})

	//some AudioNode/etc-specific options
	if (!format.channels && (obj.channelCount || obj.numberOfChannels)) {
		format.channels = obj.channelCount || obj.numberOfChannels
	}
	if (!format.sampleRate && obj.rate) {
		format.sampleRate = obj.rate
	}

	return format
}
function fromObject ( obj ) { //else retrieve format properties from object var format = { } formatProperties . forEach ( function ( key ) { if ( obj [ key ] != null ) format [ key ] = obj [ key ] } ) //some AudioNode/etc-specific options if ( ! format . channels && ( obj . channelCount || obj . numberOfChannels ) ) { format . channels = obj . channelCount || obj . numberOfChannels } if ( ! format . sampleRate && obj . rate ) { format . sampleRate = obj . rate } return format }
Retrieve format info from object
Retrieve format info from object