# Audio Capture, Mono wav File?

**URL:** <https://forums.unrealengine.com/t/audio-capture-mono-wav-file/440008>\
**Category:** Audio\
**Tags:** wave, microphone, unreal-engine, voice, CPP, question\
**Created:** [December 23, 2018, 12:41pm UTC](https://forums.unrealengine.com/t/audio-capture-mono-wav-file/440008 "2018-12-23T12:41:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zexus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zexus](https://forums.unrealengine.com/u/Zexus)\
**Post date:** [December 23, 2018, 12:41pm UTC](https://forums.unrealengine.com/t/audio-capture-mono-wav-file/440008/1 "2018-12-23T12:41:14Z")

</div>

Hello guys, I’m using the new Audio Capture component to record user voice and save it as a .wav file with the following blueprint setup.

 ![263173-capture.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/0/3/d037fe4a66bef0a8f4b1ee8a8a70e925cb1134ea.png)

The resulting wav file is a Stereo wav file with 48000Hz Sampling Rate and 16 bit however I need it to be a Mono wav file with just one channel instead of 2. I have been looking for any options in the Submix, Attenuation and Audio Capture but no hope to make the recorded wav a Mono. Can anyone help with this ?

---

<div class="post-metadata">

**Author:** ![Zexus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zexus](https://forums.unrealengine.com/u/Zexus)\
**Post date:** [December 28, 2018, 10:58am UTC](https://forums.unrealengine.com/t/audio-capture-mono-wav-file/440008/2 "2018-12-28T10:58:27Z")

</div>

I managed to convert the recorded wav file from Stereo to Mono. I had to learn about how a .wav file is stored in bytes and change the file header values. I also ignored the right stereo channel and just wrote the left channel in my new .wav file. I implemented a c++ function to handle this

```
void :StereoToMono(TArray<uint8> stereoWavBytes, TArray<uint8>& monoWavBytes)
{
	//Change wav headers
	for (int i = 0; i < 44; i++)
	{
		//NumChannels starts from 22 to 24
		if (i == 22)
		{
			short NumChannels = (*(short*)&stereoWavBytes[i]) / 2;
			monoWavBytes.Append((uint8*)&NumChannels, sizeof(NumChannels));
			i++;
		}
		//ByteRate starts from 28 to 32
		else if (i == 28)
		{
			int ByteRate = (*(int*)&stereoWavBytes[i]) / 2;
			monoWavBytes.Append((uint8*)&ByteRate, sizeof(ByteRate));
			i += 3;
		}
		//BlockAlign starts from 32 to 34
		else if (i == 32)
		{
			short BlockAlign = (*(short*)&stereoWavBytes[i]) / 2;
			monoWavBytes.Append((uint8*)&BlockAlign, sizeof(BlockAlign));
			i++;
		}
		//SubChunkSize starts from 40 to 44
		else if (i == 40)
		{
			int SubChunkSize = (*(int*)&stereoWavBytes[i]) / 2;
			monoWavBytes.Append((uint8*)&SubChunkSize, sizeof(SubChunkSize));
			i += 3;
		}
		else
		{
			monoWavBytes.Add(stereoWavBytes[i]);
		}
	}

	//Copies only the left channel and ignores the right channel
	for (int i = 44; i < stereoWavBytes.Num(); i += 4)
	{
	     monoWavBytes.Add(stereoWavBytes[i]);
         monoWavBytes.Add(stereoWavBytes[i+1]);
	}
}
```

---

<div class="post-metadata">

**Author:** ![Anonymous\_7f63b68736d1a0cfda54f5b487bb32e1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_7f63b68736d1a0cfda54f5b487bb32e1](https://forums.unrealengine.com/u/Anonymous_7f63b68736d1a0cfda54f5b487bb32e1)\
**Post date:** [October 17, 2019, 7:25am UTC](https://forums.unrealengine.com/t/audio-capture-mono-wav-file/440008/3 "2019-10-17T07:25:38Z")

</div>

Excuse me Zexus: Submix Effect Preset and Submix to Record, how do you get the two variables

![290311-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/f/c/dfcf7874d08617564ab23b2323049e81ff2f8913.png)

---

<div class="post-metadata">

**Author:** ![Zexus](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zexus](https://forums.unrealengine.com/u/Zexus)\
**Post date:** [October 17, 2019, 2:34pm UTC](https://forums.unrealengine.com/t/audio-capture-mono-wav-file/440008/4 "2019-10-17T14:34:59Z")

</div>

They are basic classes that I created from the ‘New’ in the Content Browser so just create them and reference them in your Blueprints as far as I remember

---

<div class="post-metadata">

**Author:** ![designk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@designk](https://forums.unrealengine.com/u/designk)\
**Post date:** [March 8, 2023, 8:12am UTC](https://forums.unrealengine.com/t/audio-capture-mono-wav-file/440008/5 "2023-03-08T08:12:36Z")

</div>

Thanks ,u help me a lot!

---

<div class="post-metadata">

**Author:** ![Billo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Billo](https://forums.unrealengine.com/u/Billo)\
**Post date:** [September 9, 2024, 10:34am UTC](https://forums.unrealengine.com/t/audio-capture-mono-wav-file/440008/6 "2024-09-09T10:34:23Z")

</div>

Hello! I was wondering, when do you run this function? Before saving the .wav file or after? Thanks so much for your contibution!

---

<div class="post-metadata">

**Author:** ![KyonGiang](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KyonGiang](https://forums.unrealengine.com/u/KyonGiang)\
**Post date:** [October 4, 2024, 3:42pm UTC](https://forums.unrealengine.com/t/audio-capture-mono-wav-file/440008/7 "2024-10-04T15:42:01Z")

</div>

The .wav file is saved after releasing the spacebar
