diff --git a/Subsurface/Barotrauma.csproj b/Subsurface/Barotrauma.csproj index f65ad9123..2f9819604 100644 --- a/Subsurface/Barotrauma.csproj +++ b/Subsurface/Barotrauma.csproj @@ -312,7 +312,7 @@ False - .\NVorbis.dll + ..\packages\NVorbis.0.8.5.0\lib\NVorbis.dll False diff --git a/Subsurface/NVorbis.dll b/Subsurface/NVorbis.dll deleted file mode 100644 index 486be3646..000000000 Binary files a/Subsurface/NVorbis.dll and /dev/null differ diff --git a/Subsurface/Source/Sounds/OggStream.cs b/Subsurface/Source/Sounds/OggStream.cs index d877cc14f..cc02e522f 100644 --- a/Subsurface/Source/Sounds/OggStream.cs +++ b/Subsurface/Source/Sounds/OggStream.cs @@ -54,7 +54,7 @@ namespace Barotrauma.Sounds DebugConsole.ThrowError("OpenAL error: " + AL.GetErrorString(error)); #else - DebugConsole.NewMessage("OpenAL error: "+AL.GetErrorString(error), Microsoft.Xna.Framework.Color.Red); + DebugConsole.NewMessage("OpenAL error: " + AL.GetErrorString(error), Microsoft.Xna.Framework.Color.Red); #endif } } @@ -130,7 +130,8 @@ namespace Barotrauma.Sounds case ALSourceState.Stopped: lock (prepareMutex) { - Close(); + Reader.DecodedTime = TimeSpan.Zero; + Ready = false; Empty(); } break; @@ -141,15 +142,7 @@ namespace Barotrauma.Sounds lock (prepareMutex) { Preparing = true; -//#if TRACE -// logX = 7; -// LogHandler("(*", logX, logY); -// logX += 2; -//#endif Open(precache: true); -//#if TRACE -// LogHandler(")", logX++, logY); -//#endif } } } @@ -169,20 +162,9 @@ namespace Barotrauma.Sounds Prepare(); -//#if TRACE -// LogHandler("{", logX++, logY); -//#endif AL.SourcePlay(alSourceId); this.Volume = volume; - - try - { - ALHelper.Check(); - } - catch (Exception e) - { - throw new Exception ("AIHElper", e.InnerException); - } + ALHelper.Check(); Preparing = false; @@ -195,9 +177,6 @@ namespace Barotrauma.Sounds return; OggStreamer.Instance.RemoveStream(this); -//#if TRACE -// LogHandler("]", logX++, logY); -//#endif AL.SourcePause(alSourceId); ALHelper.Check(); } @@ -208,9 +187,6 @@ namespace Barotrauma.Sounds return; OggStreamer.Instance.AddStream(this); -#if TRACE - LogHandler("[", logX++, logY); -#endif AL.SourcePlay(alSourceId); ALHelper.Check(); } @@ -220,9 +196,6 @@ namespace Barotrauma.Sounds var state = AL.GetSourceState(alSourceId); if (state == ALSourceState.Playing || state == ALSourceState.Paused) { -//#if TRACE -// LogHandler("}", logX++, logY); -//#endif StopPlayback(); } @@ -232,20 +205,20 @@ namespace Barotrauma.Sounds } } - //float lowPassHfGain; - //public float LowPassHFGain - //{ - // get { return lowPassHfGain; } - // set - // { - // if (ALHelper.Efx.IsInitialized) - // { - // ALHelper.Efx.Filter(alFilterId, EfxFilterf.LowpassGainHF, lowPassHfGain = value); - // ALHelper.Efx.BindFilterToSource(alSourceId, alFilterId); - // ALHelper.Check(); - // } - // } - //} + /*float lowPassHfGain; + public float LowPassHFGain + { + get { return lowPassHfGain; } + set + { + if (ALHelper.Efx.IsInitialized) + { + ALHelper.Efx.Filter(alFilterId, EfxFilterf.LowpassGainHF, lowPassHfGain = value); + ALHelper.Efx.BindFilterToSource(alSourceId, alFilterId); + ALHelper.Check(); + } + } + }*/ float volume; public float Volume @@ -260,45 +233,31 @@ namespace Barotrauma.Sounds public bool IsLooped { get; set; } - - public void Dispose() { - Dispose(true); - GC.SuppressFinalize(this); - } + var state = AL.GetSourceState(alSourceId); + if (state == ALSourceState.Playing || state == ALSourceState.Paused) + StopPlayback(); - protected virtual void Dispose(bool disposing) - { - if (disposing) + lock (prepareMutex) { - var state = AL.GetSourceState(alSourceId); - if (state == ALSourceState.Playing || state == ALSourceState.Paused) - StopPlayback(); + OggStreamer.Instance.RemoveStream(this); - lock (prepareMutex) - { - OggStreamer.Instance.RemoveStream(this); + if (state != ALSourceState.Initial) + Empty(); - if (state != ALSourceState.Initial) - Empty(); + Close(); - Close(); - - underlyingStream.Dispose(); - } - - AL.DeleteSource(alSourceId); - AL.DeleteBuffers(alBufferIds); - - //if (ALHelper.Efx.IsInitialized) - // ALHelper.Efx.DeleteFilter(alFilterId); - - ALHelper.Check(); - #if TRACE - ALHelper.TraceMemoryUsage(LogHandler); - #endif + underlyingStream.Dispose(); } + + AL.DeleteSource(alSourceId); + AL.DeleteBuffers(alBufferIds); + + /*if (ALHelper.Efx.IsInitialized) + ALHelper.Efx.DeleteFilter(alFilterId);*/ + + ALHelper.Check(); } void StopPlayback() @@ -311,12 +270,18 @@ namespace Barotrauma.Sounds { int queued; AL.GetSource(alSourceId, ALGetSourcei.BuffersQueued, out queued); + ALHelper.Check(); + if (queued > 0) { try { AL.SourceUnqueueBuffers(alSourceId, queued); - ALHelper.Check(); + + if (AL.GetError() != ALError.NoError) + { + throw new InvalidOperationException(); + } } catch (InvalidOperationException) { @@ -338,10 +303,6 @@ namespace Barotrauma.Sounds Empty(); } } -//#if TRACE -// logX = 7; -// LogHandler(new string(Enumerable.Repeat(' ', Console.BufferWidth - 6).ToArray()), logX, logY); -//#endif } internal void Open(bool precache = false) @@ -388,7 +349,7 @@ namespace Barotrauma.Sounds readonly short[] castBuffer; readonly HashSet streams = new HashSet(); - readonly List threadLocalStreams = new List(); + readonly List threadLocalStreams = new List(); readonly Thread underlyingThread; volatile bool cancelled; @@ -432,27 +393,18 @@ namespace Barotrauma.Sounds public void Dispose() { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (disposing) + lock (singletonMutex) { - lock (singletonMutex) - { - Debug.Assert(Instance == this, "Two instances running, somehow...?"); + Debug.Assert(Instance == this, "Two instances running, somehow...?"); - cancelled = true; - lock (iterationMutex) - streams.Clear(); + cancelled = true; + lock (iterationMutex) + streams.Clear(); - Instance = null; - } + Instance = null; } } - + internal bool AddStream(OggStream stream) { lock (iterationMutex) @@ -460,7 +412,7 @@ namespace Barotrauma.Sounds } internal bool RemoveStream(OggStream stream) { - lock (iterationMutex) + lock (iterationMutex) return streams.Remove(stream); } @@ -473,12 +425,8 @@ namespace Barotrauma.Sounds CastBuffer(readSampleBuffer, castBuffer, readSamples); } AL.BufferData(bufferId, stream.Reader.Channels == 1 ? ALFormat.Mono16 : ALFormat.Stereo16, castBuffer, - readSamples * sizeof (short), stream.Reader.SampleRate); + readSamples * sizeof(short), stream.Reader.SampleRate); ALHelper.Check(); -//#if TRACE -// stream.LogHandler(readSamples == BufferSize ? "." : "|", stream.logX++, stream.logY); -// //ALHelper.TraceMemoryUsage(stream.LogHandler); -//#endif return readSamples != BufferSize; } @@ -497,7 +445,7 @@ namespace Barotrauma.Sounds { while (!cancelled) { - Thread.Sleep((int) (1000 / UpdateRate)); + Thread.Sleep((int)(1000 / UpdateRate)); if (cancelled) break; threadLocalStreams.Clear(); @@ -515,10 +463,10 @@ namespace Barotrauma.Sounds int queued; AL.GetSource(stream.alSourceId, ALGetSourcei.BuffersQueued, out queued); - //ALHelper.Check(); + ALHelper.Check(); int processed; AL.GetSource(stream.alSourceId, ALGetSourcei.BuffersProcessed, out processed); - //ALHelper.Check(); + ALHelper.Check(); if (processed == 0 && queued == stream.BufferCount) continue; @@ -530,22 +478,12 @@ namespace Barotrauma.Sounds for (int i = 0; i < tempBuffers.Length; i++) { - try - { - finished |= FillBuffer(stream, tempBuffers[i]); - } - catch - { - finished = true; - } + finished |= FillBuffer(stream, tempBuffers[i]); if (finished) { if (stream.IsLooped) - { - stream.Close(); - stream.Open(); - } + stream.Reader.DecodedTime = TimeSpan.Zero; else { streams.Remove(stream); @@ -555,7 +493,7 @@ namespace Barotrauma.Sounds } AL.SourceQueueBuffers(stream.alSourceId, tempBuffers.Length, tempBuffers); - //ALHelper.Check(); + ALHelper.Check(); if (finished && !stream.IsLooped) continue; @@ -572,9 +510,6 @@ namespace Barotrauma.Sounds var state = AL.GetSourceState(stream.alSourceId); if (state == ALSourceState.Stopped) { -//#if TRACE -// stream.LogHandler("!", stream.logX++, stream.logY); -//#endif AL.SourcePlay(stream.alSourceId); ALHelper.Check(); } @@ -583,5 +518,4 @@ namespace Barotrauma.Sounds } } } - } diff --git a/Subsurface/Source/Sounds/SoundManager.cs b/Subsurface/Source/Sounds/SoundManager.cs index 86607bc00..986a1ee64 100644 --- a/Subsurface/Source/Sounds/SoundManager.cs +++ b/Subsurface/Source/Sounds/SoundManager.cs @@ -29,6 +29,7 @@ namespace Barotrauma.Sounds try { AC = new AudioContext(); + ALHelper.Check(); } catch (DllNotFoundException e) { @@ -266,21 +267,28 @@ namespace Barotrauma.Sounds { var state = OpenTK.Audio.OpenAL.AL.GetSourceState(alSources[i]); if (state == OpenTK.Audio.OpenAL.ALSourceState.Playing || state == OpenTK.Audio.OpenAL.ALSourceState.Paused) + { Stop(i); + } OpenTK.Audio.OpenAL.AL.DeleteSource(alSources[i]); ALHelper.Check(); } - if (oggStream!=null) + if (oggStream != null) { oggStream.Stop(); oggStream.Dispose(); + + oggStream = null; } - + if (oggStreamer != null) + { oggStreamer.Dispose(); + oggStreamer = null; + } } } diff --git a/Subsurface/packages.config b/Subsurface/packages.config index dc755f697..065671582 100644 --- a/Subsurface/packages.config +++ b/Subsurface/packages.config @@ -1,4 +1,5 @@  + \ No newline at end of file diff --git a/packages/NVorbis.0.8.5.0/LICENSE b/packages/NVorbis.0.8.5.0/LICENSE new file mode 100644 index 000000000..bd12e52a0 --- /dev/null +++ b/packages/NVorbis.0.8.5.0/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2015 Andrew Ward, Ms-PL + +Microsoft Public License (Ms-PL) + +This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software. + +Definitions +The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. +A "contribution" is the original software, or any additions or changes to the software. +A "contributor" is any person that distributes its contribution under this license. +"Licensed patents" are a contributor's patent claims that read directly on its contribution. +Grant of Rights +(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. +(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. +Conditions and Limitations +(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. +(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. +(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. +(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. +(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. diff --git a/packages/NVorbis.0.8.5.0/NVorbis.0.8.5.0.nupkg b/packages/NVorbis.0.8.5.0/NVorbis.0.8.5.0.nupkg new file mode 100644 index 000000000..a6208fde2 Binary files /dev/null and b/packages/NVorbis.0.8.5.0/NVorbis.0.8.5.0.nupkg differ diff --git a/packages/NVorbis.0.8.5.0/NVorbis.0.8.5.0.nuspec b/packages/NVorbis.0.8.5.0/NVorbis.0.8.5.0.nuspec new file mode 100644 index 000000000..61a783b73 --- /dev/null +++ b/packages/NVorbis.0.8.5.0/NVorbis.0.8.5.0.nuspec @@ -0,0 +1,21 @@ + + + + NVorbis + 0.8.5.0 + NVorbis + Andrew Ward + Andrew Ward + http://nvorbis.codeplex.com/license + http://nvorbis.codeplex.com/ + false + A fully managed implementation of a Xiph.org Foundation Ogg Vorbis decoder. + A managed Xiph.org Foundation Ogg Vorbis decoder + - BugFix: Fix occasional crashes streaming tracks on multiple threads + en-US + ogg vorbis xiph audio c# sound .NET + + + + + \ No newline at end of file diff --git a/packages/NVorbis.0.8.5.0/README b/packages/NVorbis.0.8.5.0/README new file mode 100644 index 000000000..6d37a3395 --- /dev/null +++ b/packages/NVorbis.0.8.5.0/README @@ -0,0 +1,123 @@ +NVorbis +------- + +NVorbis is a .Net library for decoding Xiph.org Vorbis files. It is designed to run in +partial trust environments and does not require P/Invoke or unsafe code. + +This implementation is based on the Vorbis specification found on xiph.org. The MDCT +and Huffman codeword generator were borrowed from public domain implementations in +https://github.com/nothings/stb/blob/master/stb_vorbis.c. + +Currently the only container supported is Xiph.org Ogg. Ogg Skeleton and Matroska / WebM +are planned (no ETA, though). RTP support is possible, but not planned. + +To use: + +- Create an instance of NVorbis.VorbisReader (pass the Ogg Vorbis filename in) +- Use these properties to gather data about the logical stream: + - Channels + - SampleRate + - TotalTime - A TimeSpan indicating the total length of the audio data + - DecodedTime - A TimeSpan indicating the last returned sample's timestamp + - NominalBitrate, UpperBitrate, and LowerBitrate + - These are the encoder's reported bitrates + - Vendor - The encoder's vendor string + - Comments - An array of comments in the file (usually tags) +- Call "int ReadSamples(float[], int, int)" to retrieve the next batch of + samples. It will return 0 when the logical Vorbis stream is done. + + +- For NAudio support: + - Reference NVorbis.NAudioSupport.dll + - Create an instance of NVorbis.NAudioSupport.VorbisWaveReader + - VorbisWaveReader implements NAudio.Wave.WaveStream. + +History +------- +0.1 - 08/03/2012 + * Initial Release +0.2 - 08/07/2012 + * Swapped out LGPL code for public domain implementations + * Relicensed under Ms-PL + * Added NAudio support project + * Added test files & app + * Performance improvements +0.3 - 08/08/2012 + * Fixed Page / Packet decode (packets overlapping 2 pages) + * Fixed "no energy" packet handling + * Fixed packet reader not merging when unsolicited packets are added + * Added .gitignore + * Added initial multi-stream support + * Added statistics (see VorbisReader.Stats) +0.4 - 08/14/2012 + * Refactoring to clean up code and make room for later improvements + * Changed lapping algorithm to be simpler + * Switched to higher-performance clipping algorithm + * Some cleanup +0.4.1 - 09/11/2012 + * Fixed a couple Ogg container bugs + * Optimized memory allocations for better performance / memory usage +0.5 - 09/20/2012 + * Added seeking support + * Changed OggPacketReader to use a doubly-linked list for the packet queue / history + * Changed OggPacketReader.GetTotalPageCount() to count pages directly instead of making .AddPacket(...) keep a list + * Fixed a few bugs (mostly race conditions in multi-threaded playback scenarios) + * Added multi-stream support to VorbisWaveReader + * Added several info properties to VorbisWaveReader +0.5.5 - 11/15/2012 + * Added OpenTK support + * Added makefiles for Mono + * Added constructor to NAudioSupport for already opened Stream instances + * Made Ogg container logic thread-safe + * Cleanup & Optimization +0.6.0 - 06/27/2013 + * Remove ACache from project + * Make clipping optional (default: on) + * Set clipping to clamp at +/-.99999994 instead of +/-1 as a courtesy to those not outputing float samples + * Performance improvements for RingBuffer + * Performance improvements in ThreadSafeStream +0.7.0 - 07/15/2013 + * Rewrite Ogg Reader buffering logic to vastly improve memory usage + * Reorganize to more easily support other container types / work with other Ogg stream decoders + * Exposed Ogg reading types + * Performance improvements + * Bugfix: Don't throw on Vorbis streams that only have a single mode +0.7.1 - 07/18/2013 + * Removed use of generics & lambda from Huffman decoder + * Reduced computation by only processing samples that are required for output + * Bugfix: Seeking now works again + * Bugfix: OpenTKSupport.OggStream now only queues as many source buffers as it filled +0.7.2 - 07/22/2013 + * Bugfix: Floor 0 implementation is now correct + * Bugfix: Residue 0 & 1 implementation is now correct + * Bugfix: Seeking back less than the current buffer size no longer corrupts the read buffer +0.7.3 - 08/02/2013 + * Bugfix: Fix residue 1 +0.7.4 - 09/16/2013 + * Bugfix: Some stereo files with sound on only one channel decoded noise on the silent channel. +0.8.0test1 - 09/16/2013 + * Rebuilt container reading infrastructure so it is properly decoupled from the decoder + * Added unit tests for the packet reader, Ogg container reader +0.8.0 - 01/16/2014 + * Minor bugfixing to test1 + * Replaces 0.7.4 as recommended release +0.8.1 - 02/24/2014 + * Bugfix: Threading issues in Ogg reader + * Rewrite StreamReadBuffer (again) for simplicity and correctness + * Add "saved buffer" concept to StreamReadBuffer for multi-threaded performance + * Reduce Ogg reader memory usage + * Add locking for multi-threading support in Ogg reader + * Remove exception-based logic where possible for better performance +0.8.2 - 03/19/2014 + * BugFix: Don't try to copy StreamReadBuffer data when offset is bigger than source + * Add parameter change event to packet provider interface + * Refactored decoder setup so parameter change can be handled + * Rewrote packet peek / get logic for simplicity + * Refactored locking in OggPacketReader / OggContainerReader + * Improved Ogg end of stream handling + * Changed container seek API to use packets instead of indexes to reduce linked list traversals +0.8.3 - 04/29/2014 + * BugFix: Don't set the end of stream flag until the last packet of the page +0.8.4 - 11/20/2014 + * BugFix: Forward seeking when target page ends with partial packet should ignore partial packet + * Changed MDCT to be thread-safe diff --git a/packages/NVorbis.0.8.5.0/lib/NVorbis.XML b/packages/NVorbis.0.8.5.0/lib/NVorbis.XML new file mode 100644 index 000000000..8d4248df0 --- /dev/null +++ b/packages/NVorbis.0.8.5.0/lib/NVorbis.XML @@ -0,0 +1,672 @@ + + + + NVorbis + + + + + A thread-safe, read-only, buffering stream wrapper. + + + + + Provides a interface for a Vorbis logical stream container. + + + + + Gets the list of stream serials found in the container so far. + + + + + Gets whether the container supports seeking. + + + + + Gets the number of bits in the container that are not associated with a logical stream. + + + + + Gets the number of pages that have been read in the container. + + + + + Event raised when a new logical stream is found in the container. + + + + + Initializes the container and finds the first stream. + + True if a valid logical stream is found, otherwise False. + + + + Finds the next new stream in the container. + + True if a new stream was found, otherwise False. + is False. + + + + Retrieves the total number of pages in the container. + + The total number of pages. + is False. + + + + Provides packets on-demand for the Vorbis stream decoder. + + + + + Gets the serial number associated with this stream. + + + + + Gets whether seeking is supported on this stream. + + + + + Gets the number of bits of overhead in this stream's container. + + + + + Retrieves the total number of pages (or frames) this stream uses. + + The page count. + is False. + + + + Retrieves the next packet in the stream. + + The next packet in the stream or null if no more packets. + + + + Retrieves the next packet in the stream but does not advance to the following packet. + + The next packet in the stream or null if no more packets. + + + + Retrieves the packet specified from the stream. + + The index of the packet to retrieve. + The specified packet. + is less than 0 or past the end of the stream. + is False. + + + + Retrieves the total number of granules in this Vorbis stream. + + The number of samples + is False. + + + + Finds the packet index to the granule position specified in the current stream. + + The granule position to seek to. + A callback method that takes the current and previous packets and returns the number of granules in the current packet. + The index of the packet that includes the specified granule position or -1 if none found. + is less than 0 or is after the last granule. + + + + Sets the next packet to be returned, applying a pre-roll as necessary. + + The packet to key from. + The number of packets to return before the indicated packet. + + + + Occurs when the stream is about to change parameters. + + + + + Event data for when a new logical stream is found in a container. + + + + + Creates a new instance of with the specified . + + An instance. + + + + Gets new the instance. + + + + + Gets or sets whether to ignore the logical stream associated with the packet provider. + + + + + Provides an implementation for basic Ogg files. + + + + + Gets the list of stream serials found in the container so far. + + + + + Event raised when a new logical stream is found in the container. + + + + + Creates a new instance with the specified file. + + The full path to the file. + + + + Creates a new instance with the specified stream. Optionally sets to close the stream when disposed. + + The stream to read. + True to close the stream when is called, otherwise False. + + + + Initializes the container and finds the first stream. + + True if a valid logical stream is found, otherwise False. + + + + Disposes this instance. + + + + + Gets the instance for the specified stream serial. + + The stream serial to look for. + An instance. + The specified stream serial was not found. + + + + Finds the next new stream in the container. + + True if a new stream was found, otherwise False. + is False. + + + + Gets the number of pages that have been read in the container. + + + + + Retrieves the total number of pages in the container. + + The total number of pages. + is False. + + + + Gets whether the container supports seeking. + + + + + Gets the number of bits in the container that are not associated with a logical stream. + + + + + A single data packet from a logical Vorbis stream. + + + + + Defines flags to apply to the current packet + + + + + Packet is first since reader had to resync with stream. + + + + + Packet is the last in the logical stream. + + + + + Packet does not have all its data available. + + + + + Packet has a granule count defined. + + + + + Flag for use by inheritors. + + + + + Flag for use by inheritors. + + + + + Flag for use by inheritors. + + + + + Flag for use by inheritors. + + + + + Gets the value of the specified flag. + + + + + Sets the value of the specified flag. + + + + + Creates a new instance with the specified length. + + The length of the packet. + + + + Reads the next byte of the packet. + + The next byte if available, otherwise -1. + + + + Indicates that the packet has been read and its data is no longer needed. + + + + + Attempts to read the specified number of bits from the packet, but may return fewer. Does not advance the position counter. + + The number of bits to attempt to read. + The number of bits actually read. + The value of the bits read. + is not between 0 and 64. + + + + Advances the position counter by the specified number of bits. + + The number of bits to advance. + + + + Resets the bit reader. + + + + + Gets whether the packet was found after a stream resync. + + + + + Gets the position of the last granule in the packet. + + + + + Gets the position of the last granule in the page the packet is in. + + + + + Gets the length of the packet. + + + + + Gets whether the packet is the last one in the logical stream. + + + + + Gets the number of bits read from the packet. + + + + + Gets the number of granules in the packet. If null, the packet has not been decoded yet. + + + + + Reads the specified number of bits from the packet and advances the position counter. + + The number of bits to read. + The value of the bits read. + The number of bits specified is not between 0 and 64. + + + + Reads the next byte from the packet. Does not advance the position counter. + + The byte read from the packet. + + + + Reads the next byte from the packet and advances the position counter. + + The byte read from the packet. + + + + Reads the specified number of bytes from the packet and advances the position counter. + + The number of bytes to read. + A byte array holding the data read. + + + + Reads the specified number of bytes from the packet into the buffer specified and advances the position counter. + + The buffer to read into. + The index into the buffer to start placing the read data. + The number of bytes to read. + The number of bytes read. + is less than 0 or + is past the end of . + + + + Reads the next bit from the packet and advances the position counter. + + The value of the bit read. + + + + Retrieves the next 16 bits from the packet as a and advances the position counter. + + The value of the next 16 bits. + + + + Retrieves the next 32 bits from the packet as a and advances the position counter. + + The value of the next 32 bits. + + + + Retrieves the next 64 bits from the packet as a and advances the position counter. + + The value of the next 64 bits. + + + + Retrieves the next 16 bits from the packet as a and advances the position counter. + + The value of the next 16 bits. + + + + Retrieves the next 32 bits from the packet as a and advances the position counter. + + The value of the next 32 bits. + + + + Retrieves the next 64 bits from the packet as a and advances the position counter. + + The value of the next 64 bits. + + + + Advances the position counter by the specified number of bytes. + + The number of bytes to advance. + + + + Event data for when a logical stream has a parameter change. + + + + + Creates a new instance of . + + The first packet after the parameter change. + + + + Gets the first packet after the parameter change. This would typically be the parameters packet. + + + + + Gets or Sets whether to limit reads to the smallest size possible. + + + + + Gets or Sets the maximum size of the buffer. This is not a hard limit. + + + + + Gets the offset of the start of the buffered data. Reads to offsets before this are likely to require a seek. + + + + + Gets the number of bytes currently buffered. + + + + + Gets the number of bytes the buffer can hold. + + + + + Reads the number of bytes specified into the buffer given, starting with the offset indicated. + + The offset into the stream to start reading. + The buffer to read to. + The index into the buffer to start writing to. + The number of bytes to read. + The number of bytes read. + + + + Tells the buffer that it no longer needs to maintain any bytes before the indicated offset. + + The offset to discard through. + + + + Gets the number of channels in the current selected Vorbis stream + + + + + Gets the sample rate of the current selected Vorbis stream + + + + + Gets the encoder's upper bitrate of the current selected Vorbis stream + + + + + Gets the encoder's nominal bitrate of the current selected Vorbis stream + + + + + Gets the encoder's lower bitrate of the current selected Vorbis stream + + + + + Gets the encoder's vendor string for the current selected Vorbis stream + + + + + Gets the comments in the current selected Vorbis stream + + + + + Gets whether the previous short sample count was due to a parameter change in the stream. + + + + + Gets the number of bits read that are related to framing and transport alone + + + + + Gets or sets whether to automatically apply clipping to samples returned by . + + + + + Gets stats from each decoder stream available + + + + + Gets the currently-selected stream's index + + + + + Reads decoded samples from the current logical stream + + The buffer to write the samples to + The offset into the buffer to write the samples to + The number of samples to write + The number of samples written + + + + Clears the parameter change flag so further samples can be requested. + + + + + Returns the number of logical streams found so far in the physical container + + + + + Searches for the next stream in a concatenated file + + True if a new stream was found, otherwise false. + + + + Switches to an alternate logical stream. + + The logical stream index to switch to + True if the properties of the logical stream differ from those of the one previously being decoded. Otherwise, False. + + + + Gets or Sets the current timestamp of the decoder. Is the timestamp before the next sample to be decoded + + + + + Gets or Sets the current position of the next sample to be decoded. + + + + + Gets the total length of the current logical stream + + + + + Gets the counters for latency and bitrate calculations, as well as overall bit counts + + + + + Gets the calculated bit rate of audio stream data for the everything decoded so far + + + + + Gets the calculated bit rate for the last ~1 second of audio + + + + + Gets the calculated latency per page + + + + + Gets the calculated latency per packet + + + + + Gets the calculated latency per second of output + + + + + Gets the number of bits read that do not contribute to the output audio + + + + + Gets the number of bits read that contribute to the output audio + + + + + Gets the number of pages read so far in the current stream + + + + + Gets the total number of pages in the current stream + + + + + Gets whether the stream has been clipped since the last reset + + + + diff --git a/packages/NVorbis.0.8.5.0/lib/NVorbis.dll b/packages/NVorbis.0.8.5.0/lib/NVorbis.dll new file mode 100644 index 000000000..979cd8122 Binary files /dev/null and b/packages/NVorbis.0.8.5.0/lib/NVorbis.dll differ