mirror of
https://github.com/LazyDuchess/OpenTS2.git
synced 2025-01-22 16:21:47 -05:00
remove naudio
This commit is contained in:
parent
a655e26312
commit
e83c34bd45
10 changed files with 2 additions and 22726 deletions
8
Assets/Plugins/NAudio.meta
generated
8
Assets/Plugins/NAudio.meta
generated
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 96ddfba2910122b40ae2f14e29c000f2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Binary file not shown.
69
Assets/Plugins/NAudio/NAudio.dll.meta
generated
69
Assets/Plugins/NAudio/NAudio.dll.meta
generated
|
@ -1,69 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 16ab0fc7a19378e4ba4779314304ac31
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
: Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Editor: 0
|
||||
Exclude Linux64: 0
|
||||
Exclude OSXUniversal: 0
|
||||
Exclude Win: 0
|
||||
Exclude Win64: 0
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
- first:
|
||||
Standalone: Linux64
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: OSXUniversal
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: None
|
||||
- first:
|
||||
Standalone: Win
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: x86
|
||||
- first:
|
||||
Standalone: Win64
|
||||
second:
|
||||
enabled: 1
|
||||
settings:
|
||||
CPU: x86_64
|
||||
- first:
|
||||
Windows Store Apps: WindowsStoreApps
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
File diff suppressed because it is too large
Load diff
7
Assets/Plugins/NAudio/NAudio.xml.meta
generated
7
Assets/Plugins/NAudio/NAudio.xml.meta
generated
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 192b3ed9512299043ac35bc59105e17e
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,31 +0,0 @@
|
|||
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.
|
||||
|
||||
1. 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.
|
||||
|
||||
2. 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.
|
||||
|
||||
3. 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.
|
7
Assets/Plugins/NAudio/license.txt.meta
generated
7
Assets/Plugins/NAudio/license.txt.meta
generated
|
@ -1,7 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 85c47de6dc00d9347944c83b7b1aa061
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -7,8 +7,6 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using NAudio;
|
||||
using NAudio.Wave;
|
||||
using OpenTS2.Content;
|
||||
using System.IO;
|
||||
using Unity.Collections;
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
using NAudio.CoreAudioApi;
|
||||
using NAudio.Wave;
|
||||
using NAudio.Wave.SampleProviders;
|
||||
using OpenTS2.Audio;
|
||||
using OpenTS2.Common;
|
||||
using OpenTS2.Content;
|
||||
|
@ -33,8 +30,6 @@ public class TSAudioSource : MonoBehaviour
|
|||
public float Volume = 1f;
|
||||
public Action PlaybackFinished;
|
||||
private AudioAsset _audio;
|
||||
private WaveOutEvent _waveOutEv;
|
||||
private SampleChannel _sampleChannel;
|
||||
private AudioSource _audioSource;
|
||||
private float _timeAudioSourcePlaying = 0f;
|
||||
private bool _audioClipPlaying = false;
|
||||
|
@ -45,10 +40,6 @@ public class TSAudioSource : MonoBehaviour
|
|||
{
|
||||
if (_paused)
|
||||
return;
|
||||
if (_waveOutEv != null)
|
||||
{
|
||||
_waveOutEv.Pause();
|
||||
}
|
||||
_audioSource.Pause();
|
||||
_paused = true;
|
||||
}
|
||||
|
@ -57,10 +48,6 @@ public class TSAudioSource : MonoBehaviour
|
|||
{
|
||||
if (!_paused)
|
||||
return;
|
||||
if (_waveOutEv != null)
|
||||
{
|
||||
_waveOutEv.Play();
|
||||
}
|
||||
_audioSource.UnPause();
|
||||
_paused = false;
|
||||
}
|
||||
|
@ -96,7 +83,7 @@ public class TSAudioSource : MonoBehaviour
|
|||
PlayInternal(asset);
|
||||
return;
|
||||
}
|
||||
PlayWAV(asset);
|
||||
PlayWAV(asset);
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
|
@ -118,11 +105,6 @@ public class TSAudioSource : MonoBehaviour
|
|||
private void CleanUp()
|
||||
{
|
||||
StopAllCoroutines();
|
||||
if (_waveOutEv != null)
|
||||
{
|
||||
_waveOutEv.PlaybackStopped -= WaveOutPlaybackStopped;
|
||||
_waveOutEv.Dispose();
|
||||
}
|
||||
_audioSource.Stop();
|
||||
_audioSource.clip = null;
|
||||
_audioClipPlaying = false;
|
||||
|
@ -130,18 +112,6 @@ public class TSAudioSource : MonoBehaviour
|
|||
_paused = false;
|
||||
}
|
||||
|
||||
private void PlayMP3(AudioAsset asset)
|
||||
{
|
||||
var stream = new MemoryStream((asset as MP3AudioAsset).AudioData);
|
||||
var reader = new Mp3FileReader(stream);
|
||||
_sampleChannel = new SampleChannel(reader);
|
||||
_waveOutEv = new WaveOutEvent();
|
||||
_waveOutEv.Init(_sampleChannel);
|
||||
UpdateVolume();
|
||||
_waveOutEv.Play();
|
||||
_waveOutEv.PlaybackStopped += WaveOutPlaybackStopped;
|
||||
}
|
||||
|
||||
private void PlayWAV(AudioAsset asset)
|
||||
{
|
||||
_audioClipPlaying = true;
|
||||
|
@ -156,10 +126,6 @@ public class TSAudioSource : MonoBehaviour
|
|||
private void UpdateVolume()
|
||||
{
|
||||
var volume = Volume * AudioManager.Instance.GetVolumeForMixer(Mixer);
|
||||
if (_waveOutEv != null)
|
||||
{
|
||||
_sampleChannel.Volume = volume;
|
||||
}
|
||||
_audioSource.volume = volume;
|
||||
}
|
||||
|
||||
|
@ -185,16 +151,6 @@ public class TSAudioSource : MonoBehaviour
|
|||
_timeAudioSourcePlaying = 0f;
|
||||
}
|
||||
|
||||
private void WaveOutPlaybackStopped(object sender, StoppedEventArgs e)
|
||||
{
|
||||
if (_paused)
|
||||
return;
|
||||
if (Loop)
|
||||
Play();
|
||||
else
|
||||
PlaybackFinished?.Invoke();
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
CleanUp();
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace OpenTS2.Content.DBPF
|
|||
{
|
||||
if (_clip == null)
|
||||
{
|
||||
_clip = AudioClip.Create("MP3",
|
||||
_clip = AudioClip.Create(GlobalTGI.ToString(),
|
||||
(int)(_mpegFile.Length / sizeof(float) / _mpegFile.Channels),
|
||||
_mpegFile.Channels,
|
||||
_mpegFile.SampleRate,
|
||||
|
|
Loading…
Reference in a new issue