Giter Club home page Giter Club logo

audiovisualizer's People

Contributors

azure-pipelines[bot] avatar clarkezone avatar tonuv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

audiovisualizer's Issues

Memory leak

Steps to reproduce:

Hint: You have to enable native profiling and disable Just My Code in the memory profiling settings.

  1. Debug the sample app "VisualizationPlayer" with memory profiling
  2. Open a music file
  3. Force GC and make memory snapshot
  4. Repeatedly open the same or another music file. On every new opening of a music file the memory usage will increase. Do this 5-10 times.
  5. Force GC and make memory snapshot
  6. You will see that the memory usage has increased a lot.

Screenshot:
image

Link to diagsession (300MB):
https://send.firefox.com/download/f52b09a111a056c9/#2wL5zmgjieB-jPciQQTAcg

Remove dead code from project

There seem to be a number of dead code files / folders in the project eg in the samples folder. Please remove all dead code

Requested Windows Runtime type 'AudioVisualizer.PlaybackSource' is not registered

I have this error on ARM (Mobile).
"Requested Windows Runtime type 'AudioVisualizer.PlaybackSource' is not registered."
however, it works perfectly on the PC. Tested on Lumia 950XL and Lenovo Y510p
This error happens on the line below :
var _source = PlaybackSource.CreateFromAudioNode(AudioDeviceInputNode);
In the following repos

var result = await AudioGraph.CreateAsync(
       new AudioGraphSettings(AudioRenderCategory.Communications));

if (result.Status == AudioGraphCreationStatus.Success)
{
    this.graph = result.Graph;

    //var microphone = await DeviceInformation.CreateFromIdAsync(
    //  MediaDevice.GetDefaultAudioCaptureId(AudioDeviceRole.Default));

    // In my scenario I want 16K sampled, mono, 16-bit output
    var outProfile = MediaEncodingProfile.CreateM4a(AudioEncodingQuality.Low);
    //outProfile.Audio = AudioEncodingProperties.CreatePcm(16000, 1, 16);

    var outputResult = await this.graph.CreateFileOutputNodeAsync(file,
      outProfile);

    if (outputResult.Status == AudioFileNodeCreationStatus.Success)
    {
        this.outputNode = outputResult.FileOutputNode;

        var inProfile = MediaEncodingProfile.CreateWav(AudioEncodingQuality.High);

        var inputResult = await this.graph.CreateDeviceInputNodeAsync(
          MediaCategory.Speech,
          graph.EncodingProperties);

        if (inputResult.Status == AudioDeviceNodeCreationStatus.Success)
        {
            inputResult.DeviceInputNode.AddOutgoingConnection(
              this.outputNode);
            AudioDeviceInputNode = inputResult.DeviceInputNode;
            
            var _source = PlaybackSource.CreateFromAudioNode(AudioDeviceInputNode);
            _converter = new SourceConverter();
            _converter.Source = _source.Source;
            _converter.MinFrequency = 110.0f;    // Note A2
            _converter.MaxFrequency = 3520.0f;  // Note A7
            _converter.FrequencyCount = 12 * 5 * 5; // 5 octaves, 5 bars per note
            _converter.FrequencyScale = ScaleType.Logarithmic;
            _converter.SpectrumRiseTime = TimeSpan.FromMilliseconds(20);
            _converter.SpectrumFallTime = TimeSpan.FromMilliseconds(200);
            _converter.RmsRiseTime = TimeSpan.FromMilliseconds(20); // Use RMS to gate noise, fast rise slow fall
            _converter.RmsFallTime = TimeSpan.FromMilliseconds(500);
            _converter.ChannelCount = 1;
            graph.QuantumStarted += Graph_QuantumStarted;
            this.graph.Start();
        }
    }
}

Custom visualizer with Audio Graph

I need to draw a Custom Spectrum using AudioGraph to create an equalizer effect.

PlaybackSource.CreateFromMediaPlayer();

โ†“

PlaybackSource.CreateFromAudioNode();

Could you give me some sample code for drawing Custom Spectrum using AudioGraph?

Deployment failed. EntryPointNotFoundException

When I try to compile the VisualizationPlayer I get:

DEP0600: Deployment failed. EntryPointNotFoundException - Unable to find an entry point named 'IsWow64GuestMachineSupported' in DLL 'kernel32.dll'. [0x80131523]

Any ideas?

CI: Enable tests for CI builds

  • For the CIBUILD configuration, enable the test projects and ensure commandline build runs on local dev machine. This was previously failing with an error which is why we ended up disabling test
  • One about is working, test the updated configuration in appveyor to ensure it's working correctly there.
  • Figure out if there is additional work in the appveyor config to have unit tests run as a separate build step such that gated checkin's work correctly

When MediaPlayer has been playing, can't init PlaybackSource

Description

I'm developing a music player on UWP with C#. In my app, the MediaPlayer uses MediaPlaybackList as the playback source. And I can't initialize the AudioVisualizer.PlaybackSource.

Current behavior

  1. Use a MediaPlaybackList list as the MediaPlayer.Source
  2. Call MediaPlayer.Play(), music playing
  3. Use new AudioVisualizer.PlaybackSource(mediaPlayer) to get a new PlaybackSource
  4. The PlaybackSource.Source is null
  5. Call list.MoveNext(), event list.CurrentItemChanged fires, and the args.Reason is MediaPlaybackItemChangedReason.Error

Other Information

I also added a equalizer effect in the MediaPlayer, which is written in C#. But this effect won't cause MediaPlaybackItemChangedReason.Error

AudioSourceReader could not be found

I'm trying to use AudioSourceReader in a UWP app:

  1. I installed the latest Nuget https://www.nuget.org/packages/UWPAudioVisualizer/1.0.38
  2. I added using AudioVisualizer; to the .cs
  3. But I still get this error:
    image

What am I doing wrong?
Thanks

P.s.
I was able to use: AnalogVUMeter, DiscreteVUBar, SpectrumVisualizer without problems

CI: investigate versioning improvements

  • Should we start using releases / labels to flag official build versions?
  • Investigate: can we use releases / labels to trigger official version package in nuget?
  • Investigate: Git versioning: should we adopt this if so how does it work

Waveform drawing

is it possible to use this library to draw the waveform of a whole audio file in various detail, or is this just for live-drawing of the spectrum of a running audio?

[Feature Request] Waveform Analysis on any audio

Would it be possible to read in any audio source, either via by a storage file or an MediaSource instance and then perform waveform analysis on them without having to playback the item? I am basically looking to do sort of a waveform seekbar, which could look like this:

image

I think this would be a great addition to the package.

Error when playing mono audio file

When using the VisualizationPlayer to play a mono wav (attached) file getting the following error:

Exception thrown: 'System.ArgumentException' in VisualizationPlayer.exe
WinRT information: Previous data not the same size
An exception of type 'System.ArgumentException' occurred in VisualizationPlayer.exe but was not handled in user code
WinRT information: Previous data not the same size
The parameter is incorrect.

Raised from following:

_previousSpectrum = spectrumData.ApplyRiseAndFall(_previousSpectrum, _rmsRiseTime, _rmsFallTime, _frameDuration);
SampleAudio_0.4mb-mono.zip

Working with live recording

Hi, Im working with AudioGraph and I want to implement this library to display the feedback from a live recording. Is this possible?

Audio Recording with AudioGraph

I am working with audio graph on live recording i need to know sound loudness measurements for the animation part. Is this possible?

Unexpected VU levels - discrete VU bar does not display levels equal to 0db or greater

Hey there!

Thanks for this awesome repository. Been enjoying working with it and excited by the results.

One issue I'm running into is getting audio peaking to work correctly with the discrete VU bar. Without any modification, I'm unable to get it to display levels equal to or greater then 0.

I have a test audio file that has it's gain turned up so that it is consistently peaking. This is how it's levels are displayed by various pro audio software:

image

image

However, this is how it's levels appear when brought into the sample application from the Microsoft store:

image

Through experimentation, it seems that there is some kind of cut off that is preventing the meter from displaying levels greater then or equal to 0. This results in being unable to show that an audio source is peaking.

Is there something I'm missing? Basically hoping to create a bar that displays all values greater then or equal to 0db as Red so that a user may know that the audio file is peaking.

These are the levels I have assigned to my discrete VU bar:

MeterBarLevel[] newLevels = new MeterBarLevel[]

            {
                new MeterBarLevel() { Level = -60, Color = Colors.Lime },
                new MeterBarLevel() { Level = -57, Color = Colors.Lime },
                new MeterBarLevel() { Level = -54, Color = Colors.Lime },
                new MeterBarLevel() { Level = -51, Color = Colors.Lime },
                new MeterBarLevel() { Level = -48, Color = Colors.Lime },
                new MeterBarLevel() { Level = -45, Color = Colors.Lime },
                new MeterBarLevel() { Level = -42, Color = Colors.Lime },
                new MeterBarLevel() { Level = -39, Color = Colors.Lime },
                new MeterBarLevel() { Level = -36, Color = Colors.Lime },
                new MeterBarLevel() { Level = -33, Color = Colors.Lime },
                new MeterBarLevel() { Level = -30, Color = Colors.Lime },
                new MeterBarLevel() { Level = -27, Color = Colors.Lime },
                new MeterBarLevel() { Level = -24, Color = Colors.Lime },
                new MeterBarLevel() { Level = -21, Color = Colors.Lime },
                new MeterBarLevel() { Level = -18, Color = Colors.Lime },
                new MeterBarLevel() { Level = -15, Color = Colors.Lime },
                new MeterBarLevel() { Level = -12, Color = Colors.Lime },
                new MeterBarLevel() { Level = -9, Color = Colors.Lime },
                new MeterBarLevel() { Level = -6, Color = Colors.Yellow },
                new MeterBarLevel() { Level = -3, Color = Colors.Yellow },
                new MeterBarLevel() { Level = -0, Color = Colors.Red },
                new MeterBarLevel() { Level = 3, Color = Colors.Red },
                new MeterBarLevel() { Level = 6, Color = Colors.Red },

            };

Yet this is how my VU bar looks with my constantly peaking audio file as the source:
image

As you can see, no value, equal to 0 or greater, is being displayed.

Thanks for any help you can provide!

Enhancement suggestions

  • Change to transport controls provided by MediaPlayerElement and AreTransportControlsEnabled so that all the system media integration works.
  • Allow pausing to completely freeze the visualizer output frame including decay, etc. so that the spectrum can be studied at specific points in the playback.
  • Make the visualizer output be a video stream that can be cast to another Windows 10 PC or external playback device along with the audio.

Calculation of downsampleFactor does not seem right

It looks like overlapFrames is being added twice. The call to ConfigureAnalyzer passes the argument m_StepTotalFrames which already has m_StepFrameOverlap. Then in the while loop it is added again.
Is this the intent ? if yes then why ?

Thanks in advance.

HRESULT MediaAnalyzer::Analyzer_Initialize()
....
m_StepTotalFrames = m_StepFrameCount + m_StepFrameOverlap;
...
_analyzer->ConfigureAnalyzer(m_FftLength, m_StepTotalFrames, m_StepFrameOverlap);

void CAudioAnalyzer::ConfigureAnalyzer(UINT32 fftLength, UINT32 stepFrames, UINT32 overlapFrames)
...
// Calculate downsample factor, if FFT length is too short for step+overlap then downsample input
UINT32 downsampleFactor = 1;
while ((stepFrames + overlapFrames) / downsampleFactor > fftLength)
downsampleFactor++;

Sample app controls should resize better

Make the controls visualization controls in the sample app resize. Currently the drawing code isn't taking the control size into account.. ideally all the drawing code would be relative to each control instances width and height

Custom Draw To Microphone

Hello, I am new to this, I am trying to make that from the custom draw it allows me to see the frequency made by the microphone.
I am applying the method:
`async void CreateAudioGraphAsync() {
var graphResult = await AudioGraph.CreateAsync(new AudioGraphSettings(AudioRenderCategory.Media));
if (graphResult.Status == AudioGraphCreationStatus.Success) {
audioGraph = graphResult.Graph;
//Microfono selecionado:
var microphone = this.devices[this.entradaAudio];

            var inputNodeResult = await audioGraph.CreateDeviceInputNodeAsync(MediaCategory.Media, null, microphone);
            if (inputNodeResult.Status == AudioDeviceNodeCreationStatus.Success) {
                _inputNode = inputNodeResult.DeviceInputNode;
                _source2 = AudioVisualizer.PlaybackSource.CreateFromAudioNode(_inputNode);
                _converter = new SourceConverter();
                _converter.Source = _source2.Source;
                _converter.MinFrequency = 110.0f;    // Note A2
                _converter.MaxFrequency = 3520.0f;  // Note A7
                _converter.FrequencyCount = 12 * 5 * 5; // 5 octaves, 5 bars per note
                _converter.FrequencyScale = ScaleType.Logarithmic;
                _converter.SpectrumRiseTime = TimeSpan.FromMilliseconds(20);
                _converter.SpectrumFallTime = TimeSpan.FromMilliseconds(200);
                _converter.RmsRiseTime = TimeSpan.FromMilliseconds(20); // Use RMS to gate noise, fast rise slow fall
                _converter.RmsFallTime = TimeSpan.FromMilliseconds(500);
                _converter.ChannelCount = 1;
                _source.Source = _converter;

                audioGraph.Start();
            }
            else {
                MessageDialog md = new MessageDialog("Cannot access microphone");
                await md.ShowAsync();
            }
        }
    }`

But I can't get it to work, someone knows how I can make it work.
It is that I would like to take the frequency listened to in real time for a music project.

imagen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.