Skip to content
Permalink
Browse files

Removed AudioEngine project and files, moved FileEncoder to Content

  • Loading branch information...
AEllinger committed Sep 20, 2018
1 parent a2589d3 commit 4d46a9731e809ca53bc73210a4742b692ce5d429
Showing with 75 additions and 29,743 deletions.
  1. +1 −5 Projects/GeometryProcessor/GeometryProcessor.vcxproj
  2. +1 −5 Projects/ImageProcessor/ImageProcessor.vcxproj
  3. +1 −4 Projects/Win32Editor/Win32Editor.vcxproj
  4. +3 −4 Systems/Content/AudioContent.cpp
  5. +13 −12 Systems/{Sound/FileEncoder.cpp → Content/AudioFileEncoder.cpp}
  6. +3 −3 Systems/{Sound/FileEncoder.hpp → Content/AudioFileEncoder.hpp}
  7. +4 −0 Systems/Content/Content.vcxproj
  8. +12 −0 Systems/Content/Content.vcxproj.filters
  9. +1 −0 Systems/Content/ContentStandard.hpp
  10. +1 −1 Systems/{Sound → Content}/stb_vorbis.cpp
  11. 0 Systems/{Sound → Content}/stb_vorbis.h
  12. +5 −5 Systems/Sound/Audio.cpp
  13. +3 −3 Systems/Sound/AudioMixer.cpp
  14. +1 −1 Systems/Sound/AudioMixer.hpp
  15. +17 −17 Systems/Sound/FileDecoder.cpp
  16. +5 −5 Systems/Sound/FileDecoder.hpp
  17. +0 −7 Systems/Sound/Sound.vcxproj
  18. +0 −6 Systems/Sound/Sound.vcxproj.filters
  19. +0 −1 Systems/Sound/SoundStandard.hpp
  20. +0 −3 Systems/Startup/Startup.vcxproj
  21. +4 −20 Zero.sln
  22. +0 −20 ZeroLibraries/AudioEngine/.gitignore
  23. +0 −20 ZeroLibraries/AudioEngine/.hgignore
  24. +0 −284 ZeroLibraries/AudioEngine/AdditiveSynthNode.cpp
  25. +0 −107 ZeroLibraries/AudioEngine/AdditiveSynthNode.h
  26. +0 −283 ZeroLibraries/AudioEngine/Attenuator.cpp
  27. +0 −100 ZeroLibraries/AudioEngine/Attenuator.h
  28. +0 −148 ZeroLibraries/AudioEngine/AudioEngine.vcxproj
  29. +0 −261 ZeroLibraries/AudioEngine/AudioEngine.vcxproj.filters
  30. +0 −132 ZeroLibraries/AudioEngine/AudioInputOutput.cpp
  31. +0 −118 ZeroLibraries/AudioEngine/AudioInputOutput.h
  32. +0 −395 ZeroLibraries/AudioEngine/AudioSystemInterface.cpp
  33. +0 −207 ZeroLibraries/AudioEngine/AudioSystemInterface.h
  34. +0 −904 ZeroLibraries/AudioEngine/AudioSystemInternal.cpp
  35. +0 −311 ZeroLibraries/AudioEngine/AudioSystemInternal.h
  36. +0 −216 ZeroLibraries/AudioEngine/CustomDataNode.cpp
  37. +0 −71 ZeroLibraries/AudioEngine/CustomDataNode.h
  38. +0 −158 ZeroLibraries/AudioEngine/Definitions.h
  39. +0 −203 ZeroLibraries/AudioEngine/DynamicsProcessorNode.cpp
  40. +0 −90 ZeroLibraries/AudioEngine/DynamicsProcessorNode.h
  41. +0 −354 ZeroLibraries/AudioEngine/Emitter.cpp
  42. +0 −73 ZeroLibraries/AudioEngine/Emitter.h
  43. +0 −222 ZeroLibraries/AudioEngine/EqualizerNode.cpp
  44. +0 −98 ZeroLibraries/AudioEngine/EqualizerNode.h
  45. +0 −592 ZeroLibraries/AudioEngine/FileDecoder.cpp
  46. +0 −205 ZeroLibraries/AudioEngine/FileDecoder.h
  47. +0 −518 ZeroLibraries/AudioEngine/FileEncoder.cpp
  48. +0 −120 ZeroLibraries/AudioEngine/FileEncoder.h
  49. +0 −1,161 ZeroLibraries/AudioEngine/FilterNodes.cpp
  50. +0 −368 ZeroLibraries/AudioEngine/FilterNodes.h
  51. +0 −2,076 ZeroLibraries/AudioEngine/Filters.cpp
  52. +0 −623 ZeroLibraries/AudioEngine/Filters.h
  53. +0 −873 ZeroLibraries/AudioEngine/GranularSynthNode.cpp
  54. +0 −286 ZeroLibraries/AudioEngine/GranularSynthNode.h
  55. +0 −323 ZeroLibraries/AudioEngine/Interpolator.cpp
  56. +0 −102 ZeroLibraries/AudioEngine/Interpolator.h
  57. +0 −242 ZeroLibraries/AudioEngine/ListenerNode.cpp
  58. +0 −81 ZeroLibraries/AudioEngine/ListenerNode.h
  59. +0 −167 ZeroLibraries/AudioEngine/LockFreeQueue.hpp
  60. +0 −31 ZeroLibraries/AudioEngine/MIDI.h
  61. +0 −160 ZeroLibraries/AudioEngine/MicrophoneInputNode.cpp
  62. +0 −41 ZeroLibraries/AudioEngine/MicrophoneInputNode.h
  63. +0 −95 ZeroLibraries/AudioEngine/Modifiers.cpp
  64. +0 −49 ZeroLibraries/AudioEngine/Modifiers.h
  65. +0 −12 ZeroLibraries/AudioEngine/Paths.props
  66. +0 −247 ZeroLibraries/AudioEngine/PitchChange.cpp
  67. +0 −67 ZeroLibraries/AudioEngine/PitchChange.h
  68. +0 −75 ZeroLibraries/AudioEngine/PitchNode.cpp
  69. +0 −41 ZeroLibraries/AudioEngine/PitchNode.h
  70. +0 −8 ZeroLibraries/AudioEngine/Precompiled.cpp
  71. +0 −56 ZeroLibraries/AudioEngine/Precompiled.h
  72. +0 −335 ZeroLibraries/AudioEngine/RecordNode.cpp
  73. +0 −103 ZeroLibraries/AudioEngine/RecordNode.h
  74. +0 −96 ZeroLibraries/AudioEngine/Resampler.cpp
  75. +0 −37 ZeroLibraries/AudioEngine/Resampler.h
  76. +0 −147 ZeroLibraries/AudioEngine/ReverbNodes.cpp
  77. +0 −56 ZeroLibraries/AudioEngine/ReverbNodes.h
  78. +0 −143 ZeroLibraries/AudioEngine/RingBuffer.cpp
  79. +0 −65 ZeroLibraries/AudioEngine/RingBuffer.h
  80. +0 −617 ZeroLibraries/AudioEngine/SoundAssets.cpp
  81. +0 −236 ZeroLibraries/AudioEngine/SoundAssets.h
  82. +0 −1,173 ZeroLibraries/AudioEngine/SoundInstances.cpp
  83. +0 −276 ZeroLibraries/AudioEngine/SoundInstances.h
  84. +0 −912 ZeroLibraries/AudioEngine/SoundNode.cpp
  85. +0 −323 ZeroLibraries/AudioEngine/SoundNode.h
  86. +0 −756 ZeroLibraries/AudioEngine/Tags.cpp
  87. +0 −192 ZeroLibraries/AudioEngine/Tags.h
  88. +0 −376 ZeroLibraries/AudioEngine/VBAP.cpp
  89. +0 −65 ZeroLibraries/AudioEngine/VBAP.h
  90. +0 −365 ZeroLibraries/AudioEngine/VolumeNodes.cpp
  91. +0 −120 ZeroLibraries/AudioEngine/VolumeNodes.h
  92. +0 −736 ZeroLibraries/AudioEngine/WASAPI.cpp
  93. +0 −123 ZeroLibraries/AudioEngine/WASAPI.h
  94. +0 −118 ZeroLibraries/AudioEngine/WindowsMIDI.cpp
  95. +0 −32 ZeroLibraries/AudioEngine/WindowsMIDI.h
  96. +0 −981 ZeroLibraries/AudioEngine/opus.h
  97. BIN ZeroLibraries/AudioEngine/opus.lib
  98. BIN ZeroLibraries/AudioEngine/opusDebug.lib
  99. +0 −342 ZeroLibraries/AudioEngine/opus_custom.h
  100. +0 −785 ZeroLibraries/AudioEngine/opus_defines.h
  101. +0 −660 ZeroLibraries/AudioEngine/opus_multistream.h
  102. +0 −159 ZeroLibraries/AudioEngine/opus_types.h
  103. +0 −237 ZeroLibraries/AudioEngine/pa_ringbuffer.c
  104. +0 −152 ZeroLibraries/AudioEngine/pa_win_util.c
  105. +0 −5,134 ZeroLibraries/AudioEngine/stb_vorbis.cpp
  106. +0 −395 ZeroLibraries/AudioEngine/stb_vorbis.h
@@ -52,7 +52,7 @@
<AdditionalIncludeDirectories>$(ZeroSource)\External\Assimp\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(ZERO_SOURCE)\ZeroLibraries\AudioEngine;$(ZeroSource)\External\Assimp\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(ZERO_SOURCE)Systems\Sound;$(ZeroSource)\External\Assimp\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
</Link>
<PostBuildEvent>
@@ -135,10 +135,6 @@ copy "$(TargetDir)$(TargetFileName)" "$(ZERO_SOURCE)\Tools\GeometryProcessor\$(C
<ProjectReference Include="..\..\Systems\Engine\Engine.vcxproj">
<Project>{b45f9232-8734-48ea-ac16-29f41866d676}</Project>
</ProjectReference>
<ProjectReference Include="..\..\ZeroLibraries\AudioEngine\AudioEngine.vcxproj">
<Project>{fa3c580e-8e06-466a-8eb1-34bb2efed4fa}</Project>
<UseLibraryDependencyInputs>true</UseLibraryDependencyInputs>
</ProjectReference>
<ProjectReference Include="..\..\ZeroLibraries\Common\Common.vcxproj">
<Project>{3a62ce69-835e-4d16-86c2-5326625a18bc}</Project>
<UseLibraryDependencyInputs>true</UseLibraryDependencyInputs>
@@ -52,7 +52,7 @@
<AdditionalIncludeDirectories>$(ZeroSource)\External\Nvtt\include;$%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalLibraryDirectories>$(ZERO_SOURCE)\ZeroLibraries\AudioEngine;$(ZeroSource)\External\Nvtt\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(ZERO_SOURCE)\Systems\Sound;$(ZeroSource)\External\Nvtt\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<OutputFile>$(OutDir)$(ProjectName).exe</OutputFile>
</Link>
<PostBuildEvent>
@@ -105,10 +105,6 @@ copy "$(TargetDir)$(TargetFileName)" "$(ZERO_SOURCE)\Tools\ImageProcessor\$(Conf
<ProjectReference Include="..\..\Systems\Engine\Engine.vcxproj">
<Project>{b45f9232-8734-48ea-ac16-29f41866d676}</Project>
</ProjectReference>
<ProjectReference Include="..\..\ZeroLibraries\AudioEngine\AudioEngine.vcxproj">
<Project>{fa3c580e-8e06-466a-8eb1-34bb2efed4fa}</Project>
<UseLibraryDependencyInputs>true</UseLibraryDependencyInputs>
</ProjectReference>
<ProjectReference Include="..\..\ZeroLibraries\Common\Common.vcxproj">
<Project>{3a62ce69-835e-4d16-86c2-5326625a18bc}</Project>
<UseLibraryDependencyInputs>true</UseLibraryDependencyInputs>
@@ -90,7 +90,7 @@ COPY /Y "$(OutDir)\..\ChromeSubProcess\ChromeSubProcess.exe" "$(OutDir)\ChromeSu
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Link>
<AdditionalLibraryDirectories>$(ZERO_SOURCE)\External\Curl\lib\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(ZERO_SOURCE)\External\Curl\lib\Debug;$(ZERO_SOURCE)Systems\Sound;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
@@ -215,9 +215,6 @@ COPY /Y "$(OutDir)\..\ChromeSubProcess\ChromeSubProcess.exe" "$(OutDir)\ChromeSu
<Copy_Data_File Include="..\Win32Shared\Configuration.data" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\ZeroLibraries\AudioEngine\AudioEngine.vcxproj">
<Project>{fa3c580e-8e06-466a-8eb1-34bb2efed4fa}</Project>
</ProjectReference>
<ProjectReference Include="$(ZeroExtensionLibrariesSource)\Dash\Dash.vcxproj">
<Project>{f1597a26-9f2d-473a-827c-0ce8c758763d}</Project>
</ProjectReference>
@@ -8,7 +8,7 @@
///
///////////////////////////////////////////////////////////////////////////////
#include "Precompiled.hpp"
#include "AudioEngine/AudioSystemInterface.h"
#include "../Sound/SoundStandard.hpp"

namespace Zero
{
@@ -84,13 +84,12 @@ void SoundBuilder::BuildContent(BuildOptions& options)
String destFile = FilePath::Combine(options.OutputPath, BuildString(Name, SoundExtension));

// Create the AudioFile object and open the source file
Audio::AudioFile audioFile;
audioFile.OpenFile(status, sourceFile);
AudioFileData audioFile = AudioFileEncoder::OpenFile(status, sourceFile);

if (status.Succeeded())
{
// Encode the file and write it out to disk
audioFile.WriteEncodedFile(status, destFile, mNormalize, mMaxVolume);
AudioFileEncoder::WriteFile(status, destFile, audioFile, mNormalize, mMaxVolume);

if (status.Failed())
DoNotifyWarning("Error Processing Audio File", status.Message);
@@ -6,7 +6,8 @@

#include "Precompiled.hpp"
#include "stb_vorbis.h"
#include "opus.h"
#include "../Sound/opus.h"
#include "../Sound/Definitions.hpp"

namespace Zero
{
@@ -52,7 +53,7 @@ void AudioFileData::ReleaseData()
//----------------------------------------------------------------------------------- File Encoder

//************************************************************************************************
AudioFileData FileEncoder::OpenFile(Status& status, StringParam fileName)
AudioFileData AudioFileEncoder::OpenFile(Status& status, StringParam fileName)
{
AudioFileData data;
File file;
@@ -105,7 +106,7 @@ AudioFileData FileEncoder::OpenFile(Status& status, StringParam fileName)
}

//************************************************************************************************
void FileEncoder::WriteFile(Status& status, StringParam outputFileName, AudioFileData& data,
void AudioFileEncoder::WriteFile(Status& status, StringParam outputFileName, AudioFileData& data,
bool normalize, float maxVolume)
{
// Open the output file
@@ -134,7 +135,7 @@ void FileEncoder::WriteFile(Status& status, StringParam outputFileName, AudioFil
}

//************************************************************************************************
void FileEncoder::ReadWav(Status& status, File& file, StringParam fileName, AudioFileData& data)
void AudioFileEncoder::ReadWav(Status& status, File& file, StringParam fileName, AudioFileData& data)
{
// Read in the next chunk header
WavChunkHeader chunkHeader;
@@ -210,7 +211,7 @@ void FileEncoder::ReadWav(Status& status, File& file, StringParam fileName, Audi
}

//************************************************************************************************
void FileEncoder::ReadOgg(Status& status, File& file, StringParam fileName, AudioFileData& data)
void AudioFileEncoder::ReadOgg(Status& status, File& file, StringParam fileName, AudioFileData& data)
{
// Reset to beginning of file
file.Seek(0);
@@ -265,7 +266,7 @@ void FileEncoder::ReadOgg(Status& status, File& file, StringParam fileName, Audi
}

//************************************************************************************************
bool FileEncoder::PcmToFloat(byte* inputBuffer, float** samplesPerChannel,
bool AudioFileEncoder::PcmToFloat(byte* inputBuffer, float** samplesPerChannel,
const unsigned totalSampleCount, const unsigned channelCount, const unsigned bytesPerSample)
{
// 16 bit data can be read as shorts
@@ -314,7 +315,7 @@ bool FileEncoder::PcmToFloat(byte* inputBuffer, float** samplesPerChannel,
}

//************************************************************************************************
void FileEncoder::Normalize(float** samplesPerChannel, const unsigned frames,
void AudioFileEncoder::Normalize(float** samplesPerChannel, const unsigned frames,
const unsigned channels, float maxVolume)
{
// Save variables for finding the maximum volume in the audio data
@@ -348,7 +349,7 @@ void FileEncoder::Normalize(float** samplesPerChannel, const unsigned frames,
}

//************************************************************************************************
unsigned FileEncoder::Resample(unsigned fileSampleRate, unsigned channels, unsigned samplesPerChannel,
unsigned AudioFileEncoder::Resample(unsigned fileSampleRate, unsigned channels, unsigned samplesPerChannel,
float**& buffersPerChannel)
{
// Get the factor to use while resampling
@@ -396,7 +397,7 @@ unsigned FileEncoder::Resample(unsigned fileSampleRate, unsigned channels, unsig
}

//************************************************************************************************
void FileEncoder::EncodeFile(Status& status, File& outputFile, AudioFileData& data,
void AudioFileEncoder::EncodeFile(Status& status, File& outputFile, AudioFileData& data,
float** buffersPerChannel)
{
// Create the buffer for encoded packets
@@ -504,11 +505,11 @@ void PacketEncoder::EncodePacket(const float* dataBuffer, const unsigned samples
Array<byte>& encodedData)
{
ReturnIf(!Encoder, , "Tried to encode packet without initializing encoder");
ReturnIf(samples != FileEncoder::cPacketFrames, , "Tried to encode packet with incorrect number of samples");
ReturnIf(samples != AudioFileEncoder::cPacketFrames, , "Tried to encode packet with incorrect number of samples");

encodedData.Resize(FileEncoder::cMaxPacketSize);
encodedData.Resize(AudioFileEncoder::cMaxPacketSize);
unsigned encodedDataSize = opus_encode_float(Encoder, dataBuffer, samples, encodedData.Data(),
FileEncoder::cMaxPacketSize);
AudioFileEncoder::cMaxPacketSize);
encodedData.Resize(encodedDataSize);
}

@@ -35,13 +35,13 @@ class AudioFileData

//------------------------------------------------------------------------------------- File Encoder

class FileEncoder
class AudioFileEncoder
{
public:
// Opens the specified file and reads in the raw data
static AudioFileData OpenFile(Status& status, StringParam fileName);
// Encodes the audio file and writes it out to the specified file name
static void WriteFile(Status& status, StringParam outputFileName, AudioFileData& fileData,
static void WriteFile(Status& status, StringParam outputFileName, AudioFileData& fileData,
bool normalize, float maxVolume);

// 20 ms of audio data at 48000 samples per second
@@ -64,7 +64,7 @@ class FileEncoder
static unsigned Resample(unsigned fileSampleRate, unsigned channels, unsigned samplesPerChannel,
float**& buffersPerChannel);
// Encodes the audio data and writes it out to the file
static void EncodeFile(Zero::Status& status, Zero::File& outputFile, AudioFileData& data,
static void EncodeFile(Status& status, File& outputFile, AudioFileData& data,
float** buffersPerChannel);
};

@@ -44,6 +44,7 @@
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="AudioFileEncoder.hpp" />
<ClInclude Include="BinaryContent.hpp" />
<ClInclude Include="BuildOptions.hpp" />
<ClInclude Include="ContentEnumerations.hpp" />
@@ -64,6 +65,7 @@
<ClInclude Include="BaseBuilders.hpp" />
<ClInclude Include="RichAnimation.hpp" />
<ClInclude Include="SpriteBuilder.hpp" />
<ClInclude Include="stb_vorbis.h" />
<ClInclude Include="SupportComponents.hpp" />
<ClInclude Include="TagsContent.hpp" />
<ClInclude Include="TextContent.hpp" />
@@ -72,6 +74,7 @@
<ClInclude Include="ZilchPluginContent.hpp" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="AudioFileEncoder.cpp" />
<ClCompile Include="BinaryContent.cpp" />
<ClCompile Include="ContentStandard.cpp" />
<ClCompile Include="ContentSystem.cpp" />
@@ -93,6 +96,7 @@
<ClCompile Include="BaseBuilders.cpp" />
<ClCompile Include="RichAnimation.cpp" />
<ClCompile Include="SpriteBuilder.cpp" />
<ClCompile Include="stb_vorbis.cpp" />
<ClCompile Include="SupportComponents.cpp" />
<ClCompile Include="TagsContent.cpp" />
<ClCompile Include="TextContent.cpp" />
@@ -102,6 +102,12 @@
<ClInclude Include="FileExtensionManager.hpp">
<Filter>ContentTypes</Filter>
</ClInclude>
<ClInclude Include="AudioFileEncoder.hpp">
<Filter>Support</Filter>
</ClInclude>
<ClInclude Include="stb_vorbis.h">
<Filter>Support</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="ContentSystem.cpp">
@@ -176,5 +182,11 @@
<ClCompile Include="FileExtensionManager.cpp">
<Filter>ContentTypes</Filter>
</ClCompile>
<ClCompile Include="AudioFileEncoder.cpp">
<Filter>Support</Filter>
</ClCompile>
<ClCompile Include="stb_vorbis.cpp">
<Filter>Support</Filter>
</ClCompile>
</ItemGroup>
</Project>
@@ -48,6 +48,7 @@ class ZeroNoImportExport ContentMetaLibrary : public Zilch::StaticLibrary
#include "ZilchPluginContent.hpp"
#include "VectorContent.hpp"
#include "TextureBuilder.hpp"
#include "AudioFileEncoder.hpp"
#include "AudioContent.hpp"
#include "ImportOptions.hpp"
#include "ImageContent.hpp"
@@ -1,5 +1,5 @@

#include "Precompiled.h"
#include "Precompiled.hpp"
#include "stb_vorbis.h"


File renamed without changes.
@@ -18,11 +18,11 @@
typedef void WASAPICallbackType(float* outputBuffer, float* inputBuffer, const unsigned frameCount,
void* userData);

//const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator);
//const IID IID_IMMDeviceEnumerator = __uuidof(IMMDeviceEnumerator);
//const IID IID_IAudioClient = __uuidof(IAudioClient);
//const IID IID_IAudioRenderClient = __uuidof(IAudioRenderClient);
//const IID IID_IAudioCaptureClient = __uuidof(IAudioCaptureClient);
const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator);
const IID IID_IMMDeviceEnumerator = __uuidof(IMMDeviceEnumerator);
const IID IID_IAudioClient = __uuidof(IAudioClient);
const IID IID_IAudioRenderClient = __uuidof(IAudioRenderClient);
const IID IID_IAudioCaptureClient = __uuidof(IAudioCaptureClient);

namespace Zero
{
@@ -687,7 +687,7 @@ void AudioMixer::DispatchMicrophoneInput()
// Add the input samples to the end of the buffer
PreviousInputSamples.Append(inputData.All());

unsigned totalPacketSamples = FileEncoder::cPacketFrames * channels;
unsigned totalPacketSamples = AudioFileEncoder::cPacketFrames * channels;

// While we have at least the number of samples for a packet, encode them
while (PreviousInputSamples.Size() > totalPacketSamples)
@@ -696,7 +696,7 @@ void AudioMixer::DispatchMicrophoneInput()

// If the system is in mono, just add samples
if (channels == 1)
monoSamples.Append(PreviousInputSamples.SubRange(0, FileEncoder::cPacketFrames));
monoSamples.Append(PreviousInputSamples.SubRange(0, AudioFileEncoder::cPacketFrames));
else
{
// Translate samples to mono
@@ -716,7 +716,7 @@ void AudioMixer::DispatchMicrophoneInput()

// Encode the packet
Zero::Array<byte> dataArray;
Encoder.EncodePacket(monoSamples.Data(), FileEncoder::cPacketFrames, dataArray);
Encoder.EncodePacket(monoSamples.Data(), AudioFileEncoder::cPacketFrames, dataArray);

// Send the event with the encoded data
AudioByteDataEvent event;
@@ -86,7 +86,7 @@ class AudioMixer : public EventObject
// If true, will send microphone input data to external system
ThreadedInt mSendMicrophoneInputData;
// List of decoding tasks used if the system is not threaded
Array<FileDecoder*> DecodingTasks;
Array<AudioFileDecoder*> DecodingTasks;
// The maximum number of decoding tasks that will be processed on one update
// (this number is arbitrary and can be changed)
static const unsigned MaxDecodingTasksToRun = 10;
Oops, something went wrong.

0 comments on commit 4d46a97

Please sign in to comment.
You can’t perform that action at this time.