有没有人知道winamp的EQ调节功能,和波形显示器是怎么做的?有源代码吗?原理也行。一定给高分!!!!!

五行擒拿术 2001-05-24 01:42:00
有没有人知道winamp的EQ调节功能,和波形显示器是怎么做的?有源代码吗?原理也行。一定给高分!!!!!

播放mp3时,我怎么才能得到波形的数据?还有,eq功能是怎么实现的?它是调节声音的频率?还是什么的?能给出这些功能的Api函数吗?
...全文
216 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
coolstar 2001-07-02
  • 打赏
  • 举报
回复
上面的是波形显示器的源代码vis.c和vis.h
GolemZ 2001-07-02
  • 打赏
  • 举报
回复
Kevin_qing 2001-07-02
  • 打赏
  • 举报
回复
_
coolstar 2001-07-02
  • 打赏
  • 举报
回复
你发了,我有插件代码:

// Winamp test visualization library v1.0
// Copyright (C) 1997-1998, Justin Frankel/Nullsoft
// Feel free to base any plugins on this "framework"...

#include <windows.h>

#include "vis.h"

char szAppName[] = "SimpleVis"; // Our window class, etc

// configuration declarations
int config_x=50, config_y=50; // screen X position and Y position, repsectively
void config_read(struct winampVisModule *this_mod); // reads the configuration
void config_write(struct winampVisModule *this_mod); // writes the configuration
void config_getinifn(struct winampVisModule *this_mod, char *ini_file); // makes the .ini file filename

// returns a winampVisModule when requested. Used in hdr, below
winampVisModule *getModule(int which);

// "member" functions
void config(struct winampVisModule *this_mod); // configuration dialog
int init(struct winampVisModule *this_mod); // initialization for module
int render1(struct winampVisModule *this_mod); // rendering for module 1
int render2(struct winampVisModule *this_mod); // rendering for module 2
int render3(struct winampVisModule *this_mod); // rendering for module 3
void quit(struct winampVisModule *this_mod); // deinitialization for module

// our window procedure
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
HWND hMainWnd; // main window handle

// Double buffering data
HDC memDC; // memory device context
HBITMAP memBM, // memory bitmap (for memDC)
oldBM; // old bitmap (from memDC)


// Module header, includes version, description, and address of the module retriever function
winampVisHeader hdr = { VIS_HDRVER, "Nullsoft Test Visualization Library v1.0", getModule };

// first module (oscilliscope)
winampVisModule mod1 =
{
"Oscilliscope",
NULL, // hwndParent
NULL, // hDllInstance
0, // sRate
0, // nCh
25, // latencyMS
25, // delayMS
0, // spectrumNch
2, // waveformNch
{ 0, }, // spectrumData
{ 0, }, // waveformData
config,
init,
render1,
quit
};

// second module (spectrum analyser)
winampVisModule mod2 =
{
"Spectrum Analyser",
NULL, // hwndParent
NULL, // hDllInstance
0, // sRate
0, // nCh
25, // latencyMS
25, // delayMS
2, // spectrumNch
0, // waveformNch
{ 0, }, // spectrumData
{ 0, }, // waveformData
config,
init,
render2,
quit
};

// third module (VU meter)
winampVisModule mod3 =
{
"VU Meter",
NULL, // hwndParent
NULL, // hDllInstance
0, // sRate
0, // nCh
25, // latencyMS
25, // delayMS
0, // spectrumNch
2, // waveformNch
{ 0, }, // spectrumData
{ 0, }, // waveformData
config,
init,
render3,
quit
};


// this is the only exported symbol. returns our main header.
// if you are compiling C++, the extern "C" { is necessary, so we just #ifdef it
#ifdef __cplusplus
extern "C" {
#endif
__declspec( dllexport ) winampVisHeader *winampVisGetHeader()
{
return &hdr;
}
#ifdef __cplusplus
}
#endif

// getmodule routine from the main header. Returns NULL if an invalid module was requested,
// otherwise returns either mod1, mod2 or mod3 depending on 'which'.
winampVisModule *getModule(int which)
{
switch (which)
{
case 0: return &mod1;
case 1: return &mod2;
case 2: return &mod3;
default:return NULL;
}
}

// configuration. Passed this_mod, as a "this" parameter. Allows you to make one configuration
// function that shares code for all your modules (you don't HAVE to use it though, you can make
// config1(), config2(), etc...)
void config(struct winampVisModule *this_mod)
{
MessageBox(this_mod->hwndParent,"This module is Copyright (c) 1997-1998, Justin Frankel/Nullsoft\n"
"-- This is just a demonstration module, it really isn't\n"
" supposed to be enjoyable --","Configuration",MB_OK);
}

// initialization. Registers our window class, creates our window, etc. Again, this one works for
// both modules, but you could make init1() and init2()...
// returns 0 on success, 1 on failure.
int init(struct winampVisModule *this_mod)
{
int width = (this_mod == &mod3)?256:288; // width and height are the same for mod1 and mod2,
int height = (this_mod == &mod3)?32:256; // but mod3 is shaped differently

config_read(this_mod);


{ // Register our window class
WNDCLASS wc;
memset(&wc,0,sizeof(wc));
wc.lpfnWndProc = WndProc; // our window procedure
wc.hInstance = this_mod->hDllInstance; // hInstance of DLL
wc.lpszClassName = szAppName; // our window class name

if (!RegisterClass(&wc))
{
MessageBox(this_mod->hwndParent,"Error registering window class","blah",MB_OK);
return 1;
}
}


hMainWnd = CreateWindowEx(
WS_EX_TOOLWINDOW|WS_EX_APPWINDOW, // these exstyles put a nice small frame,
// but also a button in the taskbar
szAppName, // our window class name
this_mod->description, // use description for a window title
WS_VISIBLE|WS_SYSMENU, // make the window visible with a close button
config_x,config_y, // screen position (read from config)
width,height, // width & height of window (need to adjust client area later)
this_mod->hwndParent, // parent window (winamp main window)
NULL, // no menu
this_mod->hDllInstance, // hInstance of DLL
0); // no window creation data

if (!hMainWnd)
{
MessageBox(this_mod->hwndParent,"Error creating window","blah",MB_OK);
return 1;
}


SetWindowLong(hMainWnd,GWL_USERDATA,(LONG)this_mod); // set our user data to a "this" pointer

{ // adjust size of window to make the client area exactly width x height
RECT r;
GetClientRect(hMainWnd,&r);
SetWindowPos(hMainWnd,0,0,0,width*2-r.right,height*2-r.bottom,SWP_NOMOVE|SWP_NOZORDER);
}


// create our doublebuffer
memDC = CreateCompatibleDC(NULL);
memBM = CreateCompatibleBitmap(memDC,width,height);
oldBM = SelectObject(memDC,memBM);

// show the window
ShowWindow(hMainWnd,SW_SHOWNORMAL);
return 0;
}

// render function for oscilliscope. Returns 0 if successful, 1 if visualization should end.
int render1(struct winampVisModule *this_mod)
{
int x, y;
// clear background
Rectangle(memDC,0,0,288,256);
// draw oscilliscope
for (y = 0; y < this_mod->nCh; y ++)
{
MoveToEx(memDC,0,(y*256)>>(this_mod->nCh-1),NULL);
for (x = 0; x < 288; x ++)
{
LineTo(memDC,x,(y*256 + this_mod->waveformData[y][x]^128)>>(this_mod->nCh-1));
}
}
{ // copy doublebuffer to window
HDC hdc = GetDC(hMainWnd);
BitBlt(hdc,0,0,288,256,memDC,0,0,SRCCOPY);
ReleaseDC(hMainWnd,hdc);
}
return 0;
}

// render function for analyser. Returns 0 if successful, 1 if visualization should end.
int render2(struct winampVisModule *this_mod)
{
int x, y;
// clear background
Rectangle(memDC,0,0,288,256);
// draw analyser
for (y = 0; y < this_mod->nCh; y ++)
{
for (x = 0; x < 288; x ++)
{
MoveToEx(memDC,x,(y*256+256)>>(this_mod->nCh-1),NULL);
LineTo(memDC,x,(y*256 + 256 - this_mod->spectrumData[y][x])>>(this_mod->nCh-1));
}
}
{ // copy doublebuffer to window
HDC hdc = GetDC(hMainWnd);
BitBlt(hdc,0,0,288,256,memDC,0,0,SRCCOPY);
ReleaseDC(hMainWnd,hdc);
}
return 0;
}

// render function for VU meter. Returns 0 if successful, 1 if visualization should end.
int render3(struct winampVisModule *this_mod)
{
int x, y;
// clear background
Rectangle(memDC,0,0,256,32);
// draw VU meter
for (y = 0; y < 2; y ++)
{
int last=this_mod->waveformData[y][0];
int total=0;
for (x = 1; x < 576; x ++)
{
total += abs(last - this_mod->waveformData[y][x]);
last = this_mod->waveformData[y][x];
}
total /= 288;
if (total > 127) total = 127;
if (y) Rectangle(memDC,128,0,128+total,32);
else Rectangle(memDC,128-total,0,128,32);
}
{ // copy doublebuffer to window
HDC hdc = GetDC(hMainWnd);
BitBlt(hdc,0,0,256,32,memDC,0,0,SRCCOPY);
ReleaseDC(hMainWnd,hdc);
}
return 0;
}

// cleanup (opposite of init()). Destroys the window, unregisters the window class
void quit(struct winampVisModule *this_mod)
{
config_write(this_mod); // write configuration
SelectObject(memDC,oldBM); // delete our doublebuffer
DeleteObject(memDC);
DeleteObject(memBM);
DestroyWindow(hMainWnd); // delete our window
UnregisterClass(szAppName,this_mod->hDllInstance); // unregister window class
}


// window procedure for our window
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_CREATE: return 0;
case WM_ERASEBKGND: return 0;
case WM_PAINT:
{ // update from doublebuffer
PAINTSTRUCT ps;
RECT r;
HDC hdc = BeginPaint(hwnd,&ps);
GetClientRect(hwnd,&r);
BitBlt(hdc,0,0,r.right,r.bottom,memDC,0,0,SRCCOPY);
EndPaint(hwnd,&ps);
}
return 0;
case WM_DESTROY: PostQuitMessage(0); return 0;
case WM_KEYDOWN: // pass keyboard messages to main winamp window (for processing)
case WM_KEYUP:
{ // get this_mod from our window's user data
winampVisModule *this_mod = (winampVisModule *) GetWindowLong(hwnd,GWL_USERDATA);
PostMessage(this_mod->hwndParent,message,wParam,lParam);
}
return 0;
case WM_MOVE:
{ // get config_x and config_y for configuration
RECT r;
GetWindowRect(hMainWnd,&r);
config_x = r.left;
config_y = r.top;
}
return 0;
}
return DefWindowProc(hwnd,message,wParam,lParam);
}


void config_getinifn(struct winampVisModule *this_mod, char *ini_file)
{ // makes a .ini file in the winamp directory named "plugin.ini"
char *p;
GetModuleFileName(this_mod->hDllInstance,ini_file,MAX_PATH);
p=ini_file+strlen(ini_file);
while (p >= ini_file && *p != '\\') p--;
if (++p >= ini_file) *p = 0;
strcat(ini_file,"plugin.ini");
}


void config_read(struct winampVisModule *this_mod)
{
char ini_file[MAX_PATH];
config_getinifn(this_mod,ini_file);
config_x = GetPrivateProfileInt(this_mod->description,"Screen_x",config_x,ini_file);
config_y = GetPrivateProfileInt(this_mod->description,"Screen_y",config_y,ini_file);
}

void config_write(struct winampVisModule *this_mod)
{
char string[32];
char ini_file[MAX_PATH];

config_getinifn(this_mod,ini_file);

wsprintf(string,"%d",config_x);
WritePrivateProfileString(this_mod->description,"Screen_x",string,ini_file);
wsprintf(string,"%d",config_y);
WritePrivateProfileString(this_mod->description,"Screen_y",string,ini_file);
}


vis.h文件


// notes:
// any window that remains in foreground should optimally pass
// keystrokes to the parent (winamp's) window, so that the user
// can still control it. unless escape is hit, or some option
// key specific to the vis is hit. As for storing configuration,
// Configuration data should be stored in <dll directory>\plugin.ini
// Look at the example plugin for a framework.

// ints are 32 bits, and structure members are aligned on the default 8 byte boundaries
// tested with VC++ 4.2 and 5.0


typedef struct winampVisModule {
char *description; // description of module
HWND hwndParent; // parent window (filled in by calling app)
HINSTANCE hDllInstance; // instance handle to this DLL (filled in by calling app)
int sRate; // sample rate (filled in by calling app)
int nCh; // number of channels (filled in...)
int latencyMs; // latency from call of RenderFrame to actual drawing
// (calling app looks at this value when getting data)
int delayMs; // delay between calls in ms

// the data is filled in according to the respective Nch entry
int spectrumNch;
int waveformNch;
unsigned char spectrumData[2][576];
unsigned char waveformData[2][576];

void (*Config)(struct winampVisModule *this_mod); // configuration dialog
int (*Init)(struct winampVisModule *this_mod); // 0 on success, creates window, etc
int (*Render)(struct winampVisModule *this_mod); // returns 0 if successful, 1 if vis should end
void (*Quit)(struct winampVisModule *this_mod); // call when done

void *userData; // user data, optional
} winampVisModule;

typedef struct {
int version; // VID_HDRVER
char *description; // description of library
winampVisModule* (*getModule)(int);
} winampVisHeader;

// exported symbols
typedef winampVisHeader* (*winampVisGetHeaderType)();

// version of current module (0x101 == 1.01)
#define VIS_HDRVER 0x101


给分吧


这个是完整源码 java实现 大数据 Spark 可视化大屏+Kafka+SpringBoot+Vue3 【大数据毕业设计】基于Spark实时电商用户为分析与预测(Java版本+可视化大屏+Kafka+SpringBoot+Vue3) 源码+论文 完整版 数据库Mysql 随着电子商务业的快速发展,平台每天都会产生海量的用户为数据,包括浏览、加购、收藏和购买等。如何对这些为数据进实时采集、高效统计与科学预测,已成为电商运营决策和智能推荐的关键问题。传统的离线批处理方式存在延迟高、反馈慢、难以支撑实时运营的不足,因此构建一套面向实时场景的电商用户为分析与预测系统具有重要的工程意义和应用价值。 本文设计并实现了基于 Spark 的实时电商用户为分析与预测系统。系统采用前后端分离架构,后端以 Java 与 Spring Boot 为核心构建 REST 接口服务,结合 Apache Kafka 完成为事件的异步投递与缓冲,利用 Spark MLlib 对窗口销售额进线性回归预测,并将结果持久化至 MySQL;前端基于 Vue3、Element Plus 与 ECharts 实现管理后台与可视化大屏。系统主要功能包括管理员登录与个人中心、数据概览、为数据查询、商品管理、实时统计、销售额预测以及可视化大屏展示。 在数据分析方面,系统通过为模拟器持续生成 pv、cart、fav、buy 四类为事件,按时间窗口聚合 PV、UV、加购数、收藏数、购买数和销售额等指标;在预测方面,采用滞后特征与小时特征构建训练集,优先使用 Spark 线性回归模型,并在异常情况下自动降级为 Java OLS 回归,保证服务可用性。测试结果表明,系统能够稳定完成实时统计与预测展示,界面交互清晰,能够满足本科毕业设计对完整性、可用性和技术综合性的要求。
YOLOv11公交车内紧急按钮目标检测数据集 目标类别:['Bus', 'Door', 'Handle', 'bell', 'chair', 'person'] 中文类别:['公交车', '门', '扶手', '紧急按钮', '座椅', '乘客'] 训练集:6027 张 验证集:134 张 测试集:40 张 总计:6201 张 该数据集提供了data.yaml文件,内容如下: train: ../train/images val: ../valid/images test: ../test/images nc: 6 names: ['Bus', 'Door', 'Handle', 'bell', 'chair', 'person'] 该数据集聚焦于城市公共交通场景,针对公交车内部环境中的紧急按钮进精准标注与识别,具备高度的现实应用价值。通过多角度、多光照条件下的图像采集,全面覆盖了实际运营中可能出现的各类紧急按钮形态与安装位置,为提升公共交通安全监控系统的智能化水平提供了坚实的数据支撑。 该数据集包含6027张训练图像、134张验证图像和40张测试图像,总量达6201张,分布结构合理,能够有效支持模型的训练、调优与性能评估。训练集规模充足,确保模型具备良好的泛化能力;验证集与测试集虽相对较小,但样本具有代表性,可准确反映模型在真实场景下的表现稳定性。 标注工作严格按照标准执,所有目标均以绿色边界框清晰标出,标注位置精确,边界紧贴目标边缘,未出现明显偏移或遗漏现象。各类别区分明确,尤其对“紧急按钮”这一核心目标的标注一致性高,充分体现了高质量的标注规范性与专业性。 该数据集适用于智能交通、城市公交系统升级、公共安全监控等多个领域,可广泛应用于公交车内的异常为识别、紧急事件自动报警、乘客安全辅助系统等智能化解决方案中,助力构建更安全、高效的公共交通环境。共备交高通度环的境
内容概要:本文聚焦于含分布式电源的配电网可靠性评估研究,系统性地介绍了基于Matlab的仿真建模与代码实现方法,涵盖序贯蒙特卡洛模拟、分布式电源接入建模、配电网故障分析、网络重构及供电恢复策略等核心技术。研究通过构建典型配电系统模型,模拟多种故障场景,结合可靠性指标(如SAIDI、SAIFI、ASAI等)进定量评估,并深入探讨分布式电源(如光伏、风电、储能)对系统可靠性的影响机制。资源包提供了完整的Matlab代码、Simulink仿真模型及相关算法实现,支持用户复现经典案例并开展拓展研究,适用于电力系统规划、运与可靠性分析等领域。; 适合人群:具备电力系统分析基础和Matlab编程能力的研究生、科研人员及电力工程技术人员,特别适用于从事智能配电网、分布式能源接入、微电网可靠性等方向研究的专业人士。; 使用场景及目标:① 掌握配电网可靠性评估的理论体系与仿真流程;② 利用Matlab实现含分布式电源的配电网故障模拟与可靠性指标计算;③ 复现高水平论文中的可靠性分析模型与算法,提升科研复现与创新能力;④ 为学位论文、科研项目或工程实践提供可靠的技术支撑与代码参考。; 阅读建议:建议读者结合提供的网盘资源,按照“基础理论→潮流计算→故障模拟→可靠性评估”的顺序循序渐进学习,优先掌握蒙特卡洛模拟与故障隔离恢复逻辑,再深入分布式电源建模与指标统计分析。学习过程中应动手调试代码,对比不同渗透率、不同接入位置下的仿真结果,强化理论与实践的深度融合。

16,550

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧