मैं सी # भाषा और .NET Framework का उपयोग करके ध्वनि दृश्य प्रणाली बनाना चाहता हूं। यह Winamp एप्लिकेशन में दिख सकता है। शायद मुफ्त पुस्तकालय या कुछ रोचक लेख मौजूद हैं जो वर्णन करते हैं कि यह कैसे करें? उदाहरण: alt text http://img44.imageshack.us/img44/9982/examplel.pngसी # ध्वनि विज़ुअलाइजेशन
उत्तर
आप इन कड़ियों
OpenVP (संगीत दृश्यावलोकन, सी # में लिखा के विकास के लिए एक स्वतंत्र और खुला स्रोत मंच है) कोशिश कर सकते हैं, OpenVP Screenshots देखते हैं।
Play and Visualize WAV Files using Managed Direct Sound
अलविदा।
यहां एक ऐसी स्क्रिप्ट है जो WASAPI API का उपयोग कर कंप्यूटर पर खेले गए किसी भी ध्वनि के एफएफटी की गणना करती है। जब एक अलग लिपि यह पहली बार उसे लॉक करने के बाद से यह एक अलग थ्रेड पर संशोधित किया गया है अनुशंसा की जाती है से barData पुन: प्राप्त करने
using CSCore;
using CSCore.SoundIn;
using CSCore.Codecs.WAV;
using WinformsVisualization.Visualization;
using CSCore.DSP;
using CSCore.Streams;
using System;
public class SoundCapture
{
public int numBars = 30;
public int minFreq = 5;
public int maxFreq = 4500;
public int barSpacing = 0;
public bool logScale = true;
public bool isAverage = false;
public float highScaleAverage = 2.0f;
public float highScaleNotAverage = 3.0f;
LineSpectrum lineSpectrum;
WasapiCapture capture;
WaveWriter writer;
FftSize fftSize;
float[] fftBuffer;
SingleBlockNotificationStream notificationSource;
BasicSpectrumProvider spectrumProvider;
IWaveSource finalSource;
public SoundCapture()
{
// This uses the wasapi api to get any sound data played by the computer
capture = new WasapiLoopbackCapture();
capture.Initialize();
// Get our capture as a source
IWaveSource source = new SoundInSource(capture);
// From https://github.com/filoe/cscore/blob/master/Samples/WinformsVisualization/Form1.cs
// This is the typical size, you can change this for higher detail as needed
fftSize = FftSize.Fft4096;
// Actual fft data
fftBuffer = new float[(int)fftSize];
// These are the actual classes that give you spectrum data
// The specific vars of lineSpectrum here aren't that important because they can be changed by the user
spectrumProvider = new BasicSpectrumProvider(capture.WaveFormat.Channels,
capture.WaveFormat.SampleRate, fftSize);
lineSpectrum = new LineSpectrum(fftSize)
{
SpectrumProvider = spectrumProvider,
UseAverage = true,
BarCount = numBars,
BarSpacing = 2,
IsXLogScale = false,
ScalingStrategy = ScalingStrategy.Linear
};
// Tells us when data is available to send to our spectrum
var notificationSource = new SingleBlockNotificationStream(source.ToSampleSource());
notificationSource.SingleBlockRead += NotificationSource_SingleBlockRead;
// We use this to request data so it actualy flows through (figuring this out took forever...)
finalSource = notificationSource.ToWaveSource();
capture.DataAvailable += Capture_DataAvailable;
capture.Start();
}
private void Capture_DataAvailable(object sender, DataAvailableEventArgs e)
{
finalSource.Read(e.Data, e.Offset, e.ByteCount);
}
private void NotificationSource_SingleBlockRead(object sender, SingleBlockReadEventArgs e)
{
spectrumProvider.Add(e.Left, e.Right);
}
~SoundCapture()
{
capture.Stop();
capture.Dispose();
}
public float[] barData = new float[20];
public float[] GetFFtData()
{
lock (barData)
{
lineSpectrum.BarCount = numBars;
if (numBars != barData.Length)
{
barData = new float[numBars];
}
}
if (spectrumProvider.IsNewDataAvailable)
{
lineSpectrum.MinimumFrequency = minFreq;
lineSpectrum.MaximumFrequency = maxFreq;
lineSpectrum.IsXLogScale = logScale;
lineSpectrum.BarSpacing = barSpacing;
lineSpectrum.SpectrumProvider.GetFftData(fftBuffer, this);
return lineSpectrum.GetSpectrumPoints(100.0f, fftBuffer);
}
else
{
return null;
}
}
public void ComputeData()
{
float[] resData = GetFFtData();
int numBars = barData.Length;
if (resData == null)
{
return;
}
lock (barData)
{
for (int i = 0; i < numBars && i < resData.Length; i++)
{
// Make the data between 0.0 and 1.0
barData[i] = resData[i]/100.0f;
}
for (int i = 0; i < numBars && i < resData.Length; i++)
{
if (lineSpectrum.UseAverage)
{
// Scale the data because for some reason bass is always loud and treble is soft
barData[i] = barData[i] + highScaleAverage * (float)Math.Sqrt(i/(numBars + 0.0f)) * barData[i];
}
else
{
barData[i] = barData[i] + highScaleNotAverage * (float)Math.Sqrt(i/(numBars + 0.0f)) * barData[i];
}
}
}
}
}
फिर: यह CSCore और उसके WinformsVisualization उदाहरण का उपयोग करता है।
मुझे यकीन नहीं है कि मुझे GetSpectrumPoints
कहां मिला है क्योंकि यह Github Repo में प्रतीत नहीं होता है, लेकिन यहां यह है। बस इसे उस फ़ाइल में पेस्ट करें और मेरे कोड को काम करना चाहिए।
public float[] GetSpectrumPoints(float height, float[] fftBuffer)
{
SpectrumPointData[] dats = CalculateSpectrumPoints(height, fftBuffer);
float[] res = new float[dats.Length];
for (int i = 0; i < dats.Length; i++)
{
res[i] = (float)dats[i].Value;
}
return res;
}
मैंने आपके उदाहरण कोड का उपयोग करने की कोशिश की है, लेकिन ऐसा लगता है कि ['GetSpectrumPoints() 'अब एक फ़ंक्शन है] (https://github.com/filoe/cscore/blob/29410b12ae35321c4556b072c0711a8f289c0544/Samples/ Winforms विज़ुअलाइजेशन/विजुअलाइजेशन/LineSpectrum.cs # L10), और गिट रिपॉजिटरी इतिहास की जांच करना, या तो नहीं दिखाता है। क्या आप अपना जवाब स्पष्टीकरण/अपडेट करना चाहते हैं? (* मैं विंडोज़ पर ऑडियो कैप्चर/प्रसंस्करण को एक क्रॉस-प्लेटफॉर्म कंसोल एप्लिकेशन के साथ एकीकृत करने की कोशिश कर रहा हूं जो एलईडी रोशनी चलाता है; 0.0 से 1.0 बार आवृत्ति डेटा मानों की सभी आवश्यकता होती है *) – Shane
@Shane क्षमा करें! मैंने उस कोड को अभी जोड़ा, उम्मीद है कि मदद करता है – Phylliida
- 1. चेक प्रणाली ध्वनि सी #
- 2. सरल सी ++ ध्वनि एपीआई
- 3. सी # में ध्वनि chords?
- 4. Google विज़ुअलाइजेशन
- 5. Google विज़ुअलाइजेशन
- 6. ऑडियो/वॉयस विज़ुअलाइजेशन
- 7. एल्गोरिदम विज़ुअलाइजेशन कैसे करें?
- 8. जावास्क्रिप्ट नेटवर्क ग्राफ़ विज़ुअलाइजेशन
- 9. डी 3 जावास्क्रिप्ट विज़ुअलाइजेशन
- 10. जावास्क्रिप्ट नेटवर्क विज़ुअलाइजेशन?
- 11. पायथन (फ्लोचार्ट विज़ुअलाइजेशन)
- 12. Google विज़ुअलाइजेशन टेबल
- 13. यूएमएल समय विज़ुअलाइजेशन
- 14. Google विज़ुअलाइजेशन एपीआई
- 15. Google विज़ुअलाइजेशन टूलटिप
- 16. फ़्लॉइड-वॉर्शल विज़ुअलाइजेशन सुझाव?
- 17. ध्वनि
- 18. सी/सी ++/उद्देश्य-सी में ध्वनि संश्लेषण फ्रेमवर्क?
- 19. ध्वनि पहचान?
- 20. जेएसओएन से Google विज़ुअलाइजेशन एपीआई
- 21. नेट डेटा विज़ुअलाइजेशन। वाई-एक्सिस
- 22. NavigationWindow ध्वनि
- 23. ध्वनि क्लाउड
- 24. PyGame ध्वनि
- 25. पायगम, ध्वनि
- 26. अच्छी ध्वनि पुस्तकालय?
- 27. क्रॉस प्लेटफ़ॉर्म ध्वनि API
- 28. क्या सी के लिए कोई 3 डी विज़ुअलाइजेशन लाइब्रेरी या टूलकिट है? (कोई सी ++ कृपया!)
- 29. Django और इंटरैक्टिव ग्राफ/नेटवर्क विज़ुअलाइजेशन
- 30. Google विज़ुअलाइजेशन एपीआई - ऑर्ग चार्ट लेआउट
मुझे लगता है कि यह शुरुआत के लिए अच्छा होगा, धन्यवाद। –