Example #1
0
        async void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            this.systemControls = SystemMediaTransportControls.GetForCurrentView();
            this.systemControls.ButtonPressed += systemControls_ButtonPressed;
            this.systemControls.IsPlayEnabled  = true;
            this.systemControls.IsPauseEnabled = true;

            this.renderer = await AudioRenderer.CreateAsync();

            var rootPath = Windows.ApplicationModel.Package.Current.InstalledLocation.Path + "\\Sounds\\";

            this.drumPad = new DrumPad();
            this.drumPad.SetDrumSound(DrumKind.Bass, rootPath + "Drum-Bass.wav");
            this.drumPad.SetDrumSound(DrumKind.Snare, rootPath + "Drum-Snare.wav");
            this.drumPad.SetDrumSound(DrumKind.Shaker, rootPath + "Drum-Shaker.wav");
            this.drumPad.SetDrumSound(DrumKind.ClosedHiHat, rootPath + "Drum-Closed-Hi-Hat.wav");
            this.drumPad.SetDrumSound(DrumKind.Cowbell, rootPath + "Cowbell.wav");
            this.drumPad.SetDrumSound(DrumKind.OpenHiHat, rootPath + "Drum-Open-Hi-Hat.wav");
            this.drumPad.SetDrumSound(DrumKind.RideCymbal, rootPath + "Drum-Ride-Cymbal.wav");
            this.drumPad.SetDrumSound(DrumKind.FloorTom, rootPath + "developer_loud.wav");
            this.drumPad.SetDrumSound(DrumKind.HighTom, rootPath + "satya_fantastic.wav");

            this.oscillator    = new Oscillator();
            this.looper        = new Looper();
            this.demultiplexer = new AudioDemultiplexer();

            this.looper.ListenTo(this.drumPad);
            this.demultiplexer.ListenTo(this.looper);
            this.demultiplexer.ListenTo(this.oscillator);
            this.renderer.ListenTo(this.demultiplexer);

            Play();
        }
Example #2
0
        async void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            this.systemControls = SystemMediaTransportControls.GetForCurrentView();
            this.systemControls.ButtonPressed += systemControls_ButtonPressed;
            this.systemControls.IsPlayEnabled = true;
            this.systemControls.IsPauseEnabled = true;

            this.renderer = await AudioRenderer.CreateAsync();

            var rootPath = Windows.ApplicationModel.Package.Current.InstalledLocation.Path + "\\Sounds\\";
            this.drumPad = new DrumPad();
            this.drumPad.SetDrumSound(DrumKind.Bass, rootPath + "Drum-Bass.wav");
            this.drumPad.SetDrumSound(DrumKind.Snare, rootPath + "Drum-Snare.wav");
            this.drumPad.SetDrumSound(DrumKind.Shaker, rootPath + "Drum-Shaker.wav");
            this.drumPad.SetDrumSound(DrumKind.ClosedHiHat, rootPath + "Drum-Closed-Hi-Hat.wav");
            this.drumPad.SetDrumSound(DrumKind.Cowbell, rootPath + "Cowbell.wav");
            this.drumPad.SetDrumSound(DrumKind.OpenHiHat, rootPath + "Drum-Open-Hi-Hat.wav");
            this.drumPad.SetDrumSound(DrumKind.RideCymbal, rootPath + "Drum-Ride-Cymbal.wav");
            this.drumPad.SetDrumSound(DrumKind.FloorTom, rootPath + "developer_loud.wav");
            this.drumPad.SetDrumSound(DrumKind.HighTom, rootPath + "satya_fantastic.wav");

            this.oscillator = new Oscillator();
            this.looper = new Looper();
            this.demultiplexer = new AudioDemultiplexer();

            this.looper.ListenTo(this.drumPad);
            this.demultiplexer.ListenTo(this.looper);
            this.demultiplexer.ListenTo(this.oscillator);
            this.renderer.ListenTo(this.demultiplexer);

            Play();
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DirectSoundPlayer" /> class.
 /// (40ms seems to work under Vista).
 /// </summary>
 /// <param name="renderer">The renderer.</param>
 /// <param name="deviceId">Selected device</param>
 public DirectSoundPlayer(AudioRenderer renderer, Guid deviceId)
 {
     Renderer       = renderer;
     DeviceId       = deviceId == Guid.Empty ? DefaultPlaybackDeviceId : deviceId;
     DesiredLatency = 40;
     WaveFormat     = renderer.WaveFormat;
 }
Example #4
0
        public App(IBluetooth bluetooth, IAudio audio, IAudioResource audioResource)
        {
            Bluetooth     = bluetooth;
            AudioRenderer = new AudioRenderer(audio, audioResource);

            bluetooth.ConnectedDevices.CollectionChanged += (object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) => {
                if (e.OldItems != null)
                {
                    foreach (BluetoothDevice oldItem in e.OldItems)
                    {
                        oldItem.BeatReceived -= BeatReceived;
                    }
                }

                if (e.NewItems != null)
                {
                    foreach (BluetoothDevice newItem in e.NewItems)
                    {
                        newItem.BeatReceived += BeatReceived;
                    }
                }
            };

            // The root page of your application
            MainPage = new ContentPage();

            OpenScanView();
        }
Example #5
0
        private void DiscoverDevices()
        {
            Log("Cameras");
            foreach (FilterInfo fi in VideoSource.Sources())
            {
                clbCameras.Items.Add(fi);
                Log(string.Format("{0}, {1}", fi.DisplayName, fi.Moniker));
            }

            Log("\r\nMicrophones");
            // Add a blank so they can unselect the microphone
            cboMicrophones.Items.Add("<none>");
            foreach (FilterInfo fi in AudioSource.Sources())
            {
                cboMicrophones.Items.Add(fi);
                Log(string.Format("{0}, {1}", fi.DisplayName, fi.Moniker));
            }

            Log("\r\nSpeakers");
            foreach (FilterInfo fi in AudioRenderer.Renderers())
            {
                cboSpeakers.Items.Add(fi);
                Log(string.Format("{0}, {1}", fi.DisplayName, fi.Moniker));
            }
        }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DirectSoundPlayer" /> class.
 /// (40ms seems to work under Vista).
 /// </summary>
 /// <param name="renderer">The renderer.</param>
 /// <param name="deviceId">Selected device.</param>
 public DirectSoundPlayer(AudioRenderer renderer, Guid deviceId)
     : base(nameof(DirectSoundPlayer), Constants.DefaultTimingPeriod, IntervalWorkerMode.SystemDefault)
 {
     Renderer   = renderer;
     DeviceId   = deviceId == Guid.Empty ? DefaultPlaybackDeviceId : deviceId;
     WaveFormat = renderer.WaveFormat;
 }
        /// <summary>
        /// Check the registry and compare to the current list of speakers on
        /// the machine (in case there is a mismatch).  Or return the default
        /// system speaker if none were selected.
        /// </summary>
        /// <returns>
        /// The FilterInfo of the speaker that was selected and still exists
        /// </returns>
        public static FilterInfo SelectedSpeaker()
        {
            FilterInfo selectedSpeaker = AudioRenderer.DefaultFilterInfo();

            string[] regSelectedSpeaker = AVReg.ValueNames(AVReg.SelectedSpeaker);
            if (regSelectedSpeaker != null)
            {
                FilterInfo[] spkrs = AudioRenderer.Renderers();

                for (int i = 0; i < spkrs.Length; i++)
                {
                    for (int j = 0; j < regSelectedSpeaker.Length; j++)
                    {
                        if (spkrs[i].Moniker == regSelectedSpeaker[j])
                        {
                            selectedSpeaker = spkrs[i];
                            break;
                        }
                    }
                }
            }
            else
            {
                selectedSpeaker = AudioRenderer.DefaultFilterInfo();
            }

            return(selectedSpeaker);
        }
Example #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DirectSoundPlayer" /> class.
 /// (40ms seems to work under Vista).
 /// </summary>
 /// <param name="renderer">The renderer.</param>
 /// <param name="deviceId">Selected device.</param>
 public DirectSoundPlayer(AudioRenderer renderer, Guid deviceId)
     : base(nameof(DirectSoundPlayer))
 {
     Renderer   = renderer;
     DeviceId   = deviceId == Guid.Empty ? DefaultPlaybackDeviceId : deviceId;
     WaveFormat = renderer.WaveFormat;
 }
Example #9
0
    void DisposeSora()
    {
        if (sora != null)
        {
            sora.Dispose();
            sora = null;
            Debug.Log("Sora is Disposed");
            if (MultiRecv)
            {
                foreach (var track in tracks)
                {
                    GameObject.Destroy(track.Value);
                }
                tracks.Clear();
            }
            if (!Recvonly)
            {
                audioSourceInput.Stop();
                AudioRenderer.Stop();
            }

            if (unityAudioOutput)
            {
                audioSourceOutput.Stop();
            }
        }
    }
 // Start is called before the first frame update
 void Start()
 {
     particleRenderer  = this.GetComponent <ParticleSystemRenderer>();
     fireaudioRenderer = this.GetComponent <AudioRenderer>();
     cubeMeshRenderer  = this.GetComponent <MeshRenderer>();
     isHighlighted     = false;
     UpdateColor();
 }
Example #11
0
 public override void StopCapture()
 {
     if (_isRendererRecording)
     {
         _isRendererRecording = false;
         AudioRenderer.Stop();
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="WavePlayer" /> class.
 /// </summary>
 /// <param name="renderer">The renderer.</param>
 public WavePlayer(AudioRenderer renderer)
 {
     // Initialize the default values
     Renderer        = renderer;
     DeviceNumber    = -1;
     DesiredLatency  = 300;
     NumberOfBuffers = 2;
 }
Example #13
0
 public override void StartCapture()
 {
     if (!_isRendererRecording)
     {
         AudioRenderer.Start();
         _isRendererRecording = true;
     }
     FlushBuffer();
 }
Example #14
0
        public override void FlushBuffer()
        {
            int sampleFrameCount             = AudioRenderer.GetSampleCountForCaptureFrame();
            int sampleCount                  = sampleFrameCount * _unityAudioChannelCount;
            NativeArray <float> audioSamples = new NativeArray <float>(sampleCount, Allocator.Temp);

            AudioRenderer.Render(audioSamples);
            audioSamples.Dispose();
        }
Example #15
0
        protected override void Dispose(bool disposing)
        {
            if (m_render != null)
            {
                m_render.Dispose();
                m_render = null;
            }

            base.Dispose(disposing);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="LegacyAudioPlayer" /> class.
        /// </summary>
        /// <param name="renderer">The renderer.</param>
        /// <param name="deviceNumber">The device number.</param>
        public LegacyAudioPlayer(AudioRenderer renderer, int deviceNumber)
        {
            // Initialize the default values
            var deviceId = deviceNumber < -1 ? -1 : deviceNumber;

            Renderer        = renderer;
            DeviceNumber    = deviceId;
            DesiredLatency  = 200;
            NumberOfBuffers = 2;
            Capabilities    = WaveInterop.RetrieveAudioDeviceInfo(DeviceNumber);
        }
Example #17
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LegacyAudioPlayer" /> class.
        /// </summary>
        /// <param name="renderer">The renderer.</param>
        /// <param name="deviceNumber">The device number.</param>
        public LegacyAudioPlayer(AudioRenderer renderer, int deviceNumber)
            : base(nameof(LegacyAudioPlayer), Constants.DefaultTimingPeriod, IntervalWorkerMode.SystemDefault)
        {
            // Initialize the default values
            var deviceId = deviceNumber < -1 ? -1 : deviceNumber;

            Renderer        = renderer;
            DeviceNumber    = deviceId;
            DesiredLatency  = 200;
            NumberOfBuffers = 2;
            Capabilities    = WaveInterop.RetrieveAudioDeviceInfo(DeviceNumber);
        }
        bool IInitialObjectReceiver.InitializeObjects(params object[] objs)
        {
            bool success = true;

            if (objs != null && objs.Length > 0)
            {
                unregisterToEvents();
                foreach (var item in objs)
                {
                    try
                    {
                        if (item != null)
                        {
                            if (item is IDisposable)
                            {
                                shutDowner.Add(item as IDisposable);
                            }

                            if (item is AudioRenderer)
                            {
                                audioRenderer = item as AudioRenderer;
                            }
                            else if (item is InteractionManager)
                            {
                                interactionManager = item as InteractionManager;
                            }
                            else if (item.GetType().FullName.Equals("BrailleIO.BrailleIOMediator")) // is BrailleIO.BrailleIOMediator)
                            {
                                io = item as BrailleIO.BrailleIOMediator;
                                if (io == null)
                                {
                                    throw new NullReferenceException(
                                              @"The referenced Type 'BrailleIO.BrailleIOMediator' seems to be the same but a type conversion wasn't possible. 
                                        This can be caused by adding the type defining reference (dll) twice to the project. 
                                        Build the extension without local copies of overhanded types.");
                                }
                                DebugMonitorTextRenderer dbmtr = new DebugMonitorTextRenderer(monitor, io);
                            }
                        }
                    }
                    catch
                    {
                        success = false;
                    }
                }
                registerToEvents();
            }
            return(success);
        }
Example #19
0
 void Update()
 {
     if (_isRendererRecording && _capture != null && _capture.IsCapturing() && !_capture.IsPaused())
     {
         int sampleFrameCount = AudioRenderer.GetSampleCountForCaptureFrame();
         int sampleCount      = sampleFrameCount * _unityAudioChannelCount;
         // TODO: reuse NativeArray for less GC (but not super important in offline mode)
         NativeArray <float> audioSamples = new NativeArray <float>(sampleCount, Allocator.TempJob);
         if (AudioRenderer.Render(audioSamples))
         {
             // TODO: use NativeArray instead of converting to array for less GC (but not super important in offline mode)
             _capture.EncodeAudio(audioSamples.ToArray());
         }
         audioSamples.Dispose();
     }
 }
Example #20
0
        async void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            this.renderer = await AudioRenderer.CreateAsync();
            this.renderer.Start();

            var rootPath = Windows.ApplicationModel.Package.Current.InstalledLocation.Path + "\\Sounds\\";
            this.drumPad = new DrumPad();
            this.drumPad.SetDrumSound(DrumKind.Bass, rootPath + "Drum-Bass.wav");
            this.drumPad.SetDrumSound(DrumKind.Snare, rootPath + "Drum-Snare.wav");
            this.drumPad.SetDrumSound(DrumKind.Shaker, rootPath + "Drum-Shaker.wav");
            this.drumPad.SetDrumSound(DrumKind.ClosedHiHat, rootPath + "Drum-Closed-Hi-Hat.wav");
            this.drumPad.SetDrumSound(DrumKind.Cowbell, rootPath + "Cowbell.wav");
            this.drumPad.SetDrumSound(DrumKind.OpenHiHat, rootPath + "Drum-Open-Hi-Hat.wav");
            this.drumPad.SetDrumSound(DrumKind.RideCymbal, rootPath + "Drum-Ride-Cymbal.wav");
            this.drumPad.SetDrumSound(DrumKind.FloorTom, rootPath + "Drum-Floor-Tom.wav");
            this.drumPad.SetDrumSound(DrumKind.HighTom, rootPath + "Drum-High-Tom.wav");

            this.renderer.ListenTo(this.drumPad);
        }
Example #21
0
    void DisposeSora()
    {
        if (sora != null)
        {
            sora.Dispose();
            sora = null;
            Debug.Log("Sora is Disposed");
            if (!Recvonly)
            {
                audioSourceInput.Stop();
                AudioRenderer.Stop();
            }

            if (unityAudioOutput)
            {
                audioSourceOutput.Stop();
            }
        }
    }
Example #22
0
        async void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            this.renderer = await AudioRenderer.CreateAsync();

            this.renderer.Start();

            var rootPath = Windows.ApplicationModel.Package.Current.InstalledLocation.Path + "\\Sounds\\";

            this.drumPad = new DrumPad();
            this.drumPad.SetDrumSound(DrumKind.Bass, rootPath + "Drum-Bass.wav");
            this.drumPad.SetDrumSound(DrumKind.Snare, rootPath + "Drum-Snare.wav");
            this.drumPad.SetDrumSound(DrumKind.Shaker, rootPath + "Drum-Shaker.wav");
            this.drumPad.SetDrumSound(DrumKind.ClosedHiHat, rootPath + "Drum-Closed-Hi-Hat.wav");
            this.drumPad.SetDrumSound(DrumKind.Cowbell, rootPath + "Cowbell.wav");
            this.drumPad.SetDrumSound(DrumKind.OpenHiHat, rootPath + "Drum-Open-Hi-Hat.wav");
            this.drumPad.SetDrumSound(DrumKind.RideCymbal, rootPath + "Drum-Ride-Cymbal.wav");
            this.drumPad.SetDrumSound(DrumKind.FloorTom, rootPath + "Drum-Floor-Tom.wav");
            this.drumPad.SetDrumSound(DrumKind.HighTom, rootPath + "Drum-High-Tom.wav");

            this.renderer.ListenTo(this.drumPad);
        }
Example #23
0
        private void SwitchAudioRenderer(Type rendererType)
        {
            if (audioRenderer != null)
            {
                emulatedGameBoy.Bus.AudioRenderer = null;
                audioRenderer.Dispose();
                audioRenderer = null;
            }

            audioRenderer = CreateAudioRenderer(rendererType);

            ToolStripMenuItem selectedRendererMenuItem = audioRendererMenuItemDictionary[rendererType];

            foreach (ToolStripMenuItem renderMethodMenuItem in audioRendererMenuItemDictionary.Values)
            {
                renderMethodMenuItem.Checked = renderMethodMenuItem == selectedRendererMenuItem;
            }

            // Store the FullName once we know the type of render method to use
            Settings.Default.AudioRenderer = rendererType.ToString();             // Don't use AssemblyQualifiedName for easing updates, though it should be a better choice

            emulatedGameBoy.Bus.AudioRenderer = audioRenderer;
        }
Example #24
0
    private IEnumerator recordCoroutine()
    {
        var videoAttr = new VideoTrackAttributes {
            frameRate    = new MediaRational(FramesPerSecond),
            width        = Tic80Config.WIDTH,
            height       = Tic80Config.HEIGHT,
            includeAlpha = false
        };

        var audioAttr = new AudioTrackAttributes {
            sampleRate   = new MediaRational(SoundFreq),
            channelCount = 2,
            language     = "en"
        };

        int sampleFramesPerVideoFrame = audioAttr.channelCount * audioAttr.sampleRate.numerator / videoAttr.frameRate.numerator;

        var   tex       = View.Instance.GetScreenTexture();
        var   frames    = RecordTime * FramesPerSecond;
        float deltaTime = (float)1 / FramesPerSecond;

        AudioRenderer.Start();

        using (var encoder = new MediaEncoder(encodedFilePath, videoAttr, audioAttr))
            using (var audioBuffer = new NativeArray <float> (sampleFramesPerVideoFrame, Allocator.Persistent)) {
                for (int i = 0; i < frames; ++i)
                {
                    encoder.AddFrame(tex);
                    AudioRenderer.Render(audioBuffer);
                    encoder.AddSamples(audioBuffer);
                    yield return(deltaTime);
                }
            }
        AudioRenderer.Stop();
        Debug.Log("Video saved to: " + encodedFilePath);
        EditorUtility.RevealInFinder(encodedFilePath);
    }
Example #25
0
    IEnumerator Render()
    {
        while (true)
        {
            yield return(new WaitForEndOfFrame());

            if (sora != null)
            {
                sora.OnRender();
            }
            if (sora != null && !Recvonly)
            {
                var samples = AudioRenderer.GetSampleCountForCaptureFrame();
                if (AudioSettings.speakerMode == AudioSpeakerMode.Stereo)
                {
                    using (var buf = new Unity.Collections.NativeArray <float>(samples * 2, Unity.Collections.Allocator.Temp))
                    {
                        AudioRenderer.Render(buf);
                        sora.ProcessAudio(buf.ToArray(), 0, samples);
                    }
                }
            }
        }
    }
Example #26
0
    void InitSora()
    {
        DisposeSora();

        sora = new Sora();
        if (!MultiRecv)
        {
            sora.OnAddTrack = (trackId) =>
            {
                Debug.LogFormat("OnAddTrack: trackId={0}", trackId);
                this.trackId = trackId;
            };
            sora.OnRemoveTrack = (trackId) =>
            {
                Debug.LogFormat("OnRemoveTrack: trackId={0}", trackId);
                this.trackId = 0;
            };
        }
        else
        {
            sora.OnAddTrack = (trackId) =>
            {
                Debug.LogFormat("OnAddTrack: trackId={0}", trackId);
                var obj = GameObject.Instantiate(baseContent, Vector3.zero, Quaternion.identity);
                obj.name = string.Format("track {0}", trackId);
                obj.transform.SetParent(scrollViewContent.transform);
                obj.SetActive(true);
                var image = obj.GetComponent <UnityEngine.UI.RawImage>();
                image.texture = new Texture2D(320, 240, TextureFormat.RGBA32, false);
                tracks.Add(trackId, obj);
            };
            sora.OnRemoveTrack = (trackId) =>
            {
                Debug.LogFormat("OnRemoveTrack: trackId={0}", trackId);
                if (tracks.ContainsKey(trackId))
                {
                    GameObject.Destroy(tracks[trackId]);
                    tracks.Remove(trackId);
                }
            };
        }
        sora.OnNotify = (json) =>
        {
            Debug.LogFormat("OnNotify: {0}", json);
        };
        // これは別スレッドからやってくるので注意すること
        sora.OnHandleAudio = (buf, samples, channels) =>
        {
            lock (audioBuffer)
            {
                audioBuffer.Enqueue(buf);
                audioBufferSamples += samples;
            }
        };

        if (unityAudioOutput)
        {
            var audioClip = AudioClip.Create("AudioClip", 480000, 1, 48000, true, (data) =>
            {
                lock (audioBuffer)
                {
                    if (audioBufferSamples < data.Length)
                    {
                        for (int i = 0; i < data.Length; i++)
                        {
                            data[i] = 0.0f;
                        }
                        return;
                    }

                    var p = audioBuffer.Peek();
                    for (int i = 0; i < data.Length; i++)
                    {
                        data[i] = p[audioBufferPosition] / 32768.0f;
                        ++audioBufferPosition;
                        if (audioBufferPosition >= p.Length)
                        {
                            audioBuffer.Dequeue();
                            p = audioBuffer.Peek();
                            audioBufferPosition = 0;
                        }
                    }
                    audioBufferSamples -= data.Length;
                }
            });
            audioSourceOutput.clip = audioClip;
            audioSourceOutput.Play();
        }

        if (!Recvonly)
        {
            AudioRenderer.Start();
            audioSourceInput.Play();
        }
    }
        bool IInitialObjectReceiver.InitializeObjects(params object[] objs)
        {
            bool success = true;
            if (objs != null && objs.Length > 0)
            {
                unregisterToEvents();
                foreach (var item in objs)
                {
                    try
                    {
                        if (item != null)
                        {
                            if (item is IDisposable)
                            {
                                shutDowner.Add(item as IDisposable);
                            }

                            if (item is AudioRenderer)
                            {
                                audioRenderer = item as AudioRenderer;
                            }
                            else if (item is InteractionManager)
                            {
                                interactionManager = item as InteractionManager;
                            }
                            else if (item.GetType().FullName.Equals("BrailleIO.BrailleIOMediator")) // is BrailleIO.BrailleIOMediator)
                            {
                                io = item as BrailleIO.BrailleIOMediator;
                                if (io == null)
                                {
                                    throw new NullReferenceException(
                                        @"The referenced Type 'BrailleIO.BrailleIOMediator' seems to be the same but a type conversion wasn't possible. 
                                        This can be caused by adding the type defining reference (dll) twice to the project. 
                                        Build the extension without local copies of overhanded types.");
                                }
                                DebugMonitorTextRenderer dbmtr = new DebugMonitorTextRenderer(monitor, io);
                            }
                        }
                    }
                    catch
                    {
                        success = false;
                    }
                }
                registerToEvents();
            }
            return success;
        }
 void Start()
 {
     audioRenderer = gameObject.AddComponent(typeof(AudioRenderer)) as AudioRenderer;
     fileUploader  = gameObject.AddComponent(typeof(FileUploader)) as FileUploader;
     Debug.Log("START :3");
 }
Example #29
0
 private void BeatReceived(object sender, BeatEventArgs e)
 {
     AudioRenderer.PushBeat(e.Beat);
 }
Example #30
0
        protected override void Dispose(bool disposing)
        {
            if (m_render != null)
            {
                m_render.Dispose();
                m_render = null;
            }

            base.Dispose(disposing);
        }
Example #31
0
 public override void EndRecording()
 {
     AudioRenderer.Stop();
 }
Example #32
0
 public override void BeginRecording()
 {
     AudioRenderer.Start();
 }
Example #33
0
 public override void StartFrame()
 {
     buffer = new NativeArray <float>(AudioRenderer.GetSampleCountForCaptureFrame() * encoder.audioAttrs.channelCount, Allocator.Temp);
 }
Example #34
0
 public NativeArray <float> GetBuffer()
 {
     AudioRenderer.Render(buffer);
     return(buffer);
 }