HTML5 audio recording

https://labs.ericsson.com/blog/beyond-html5-audio-capture-web-browsers

the web browser is the new OS, the new desktop

all client apps will be replaced by web apps

Advertisements

c++ waveform audio recording (version 0.3)

References:

http://vismod.media.mit.edu/vismod/demos/speechcom/AudioCapture.txt

http://msdn.microsoft.com/en-us/library/ms940101(v=MSDN.10).aspx

I didn’t find any good tutorials on this topic.
I created one example.
Here is the interface:

struct AudioDataListener {
	virtual ~AudioDataListener() {}
	virtual void onNewData(void* data, int dataCountInBytes) = 0;
	virtual void onStopped() = 0;
};

struct AudioFormat {
	int bits;
	int samplesPerSecond;
	int channelCount;
};

// default 16 bits, 44.1KHz, stereo, single input device
struct AudioRecordController {
	virtual void setListener(AudioDataListener* listener) = 0;
	// check failed() to get error info
	virtual void start() = 0;
	virtual void stop() = 0;
	virtual bool failed() const = 0;
	virtual const char* getErrorMessage() const = 0;
	virtual AudioFormat getAudioFormat() const = 0;
	virtual void onDeviceStopped() = 0;
};

Here is an example of usage:

	
AudioDataListener* fileListener = new AudioDataListenerFileImpl("test.raw");

AudioRecordController* controller = new AudioRecordControllerWinImpl();
controller->setListener(fileListener);

controller->start(); exitIfError(controller);

Sleep(5000);

controller->stop(); exitIfError(controller);

trace("finished ...........");

filter

用reader读新闻有了一段时间

发觉最大的问题是信噪比太低

中文推荐的条目信噪比还可以

但是英文的就差了很多

rss里面95%以上一般都略过

google怎么做的推荐的呢?

协同过滤?

根据人气?

在信号处理领域,提高信噪比的方法是过滤,也就是filtering

那么如何对新闻条目进行过滤呢?

每个人的喜好都不一样。

人的喜好如何建模呢?

其实每个人在选择新闻的过程就是做过滤

人脑是如何过滤的呢?

喜好因子是如何算的呢?

语音和图像数据的过滤经常先把信号转换到频域,因为频域的特征更加明显,更加分离

那么文本信号呢?

归类?标签?

seed

所有的大公司都是由很小的公司发展起来,最开始的时候也许就一两个人

很多的软件最开始也是很简单,后来逐渐发展成一个巨无霸

就像一粒种子,能够长成参天大树,能够发展成一个森林

但是这个过程需要一些必备条件

第一是专注。yahoo不专注搜索,成就了专注的google。

第二是持续的创新。google之前有很多的搜索引擎,但是都没落了。

第三是面向用户。无数的人都研究搜索,写了无数paper,推出成功产品的没有几个

第四是时间。所有一夜成名的故事其实都不是一夜完成,而是十年寒窗的结果。

第五是积累。大部分产品的初期都很弱小。要超过其他的强大竞争者都需要足够力量的积累。不断的完善。

很多公司什么都作,什么都涉足。其实没有必要。

苹果只需要靠几款产品就足以超越微软。

虽然总体的研发投入少很多倍。但是单项比拼绝对不少。

很多时候,一个小的技术,一个小的产品,就足以颠覆整个行业。

老爸安全抵达

穿着西服,戴着帽子,手握长竿,酷毙了,帅呆了

开始嘉嘉还不敢跟爷爷玩

后来回到家,全家一起翻弄东西

嘉嘉看到爷爷带来一堆的新鲜玩意儿,乐坏了,跟着爷爷屁股到处跑

还学爷爷跳舞,把全家都乐坏了

要睡觉的时候嘉嘉还不愿意从爷爷房间里出来

一大清早起床嘉嘉衣服还没穿好就往爷爷房里跑

跑到门口,又回来了,还不好意思敲门,嘿嘿

最高兴的是妈妈,不再一天到晚被嘉嘉绑着了

感谢主

老婆准备的一封给签证官的信非常管用,签证官基本都没有盘问任何问题

还给了爸爸六个月的时间

态度非常友善

还专门在老婆准备的信上记上一笔,说excellent

High SNR code

Signal to Noise Ratio is the basic term to describe the noise level in signals.

The higher SNR, the cleaner.
A higher SNR signal is easier to understand, it’s easier to be decoded by human beings
A common noise source comes from mixed signals.
For instance, the background noise is usually pretty high in a restaurant or in a party, where lots of people are speaking at the same time
A single person’s talking is clear;
Two person’s talking is annoying, but human may still be able to separate them,
Three or more person’s talking are purely noise
Code is like many people’s talking
And different talking is easily mixed in code
If the talking is separated with each other, then each talking will be clear and easy to understand
Otherwise, it becomes noise
That’s the reason why Single Responsibility Principle leads to better code
Because it leads to better SNR

four steps to debug

1. visualize the information

2. locate the bug signals
3. think about the causes
4. patch

Every step is critical. 

Visualization is important. For instance, for speech processing, spectrogram is the essential tool for algorithm debugging.

Sometimes bug locating is like searching a needle in a haystack. That's also one of reasons why visualization is important.

Sometimes the causes of bug signals are not easy to figure out. This step requires domain knowledge. When domain knowledge is not enough, one need to create a new theory, such as relativity theory.

Sometimes the patch step is to propose a new algorithm.