One of the more common support requests with NAudio is how to convert MP3 files to WAV. Here’s a simple function that will do just that:

public static void Mp3ToWav(string mp3File, string outputFile)
{
    using (Mp3FileReader reader = new Mp3FileReader(mp3File))
    {
        using (WaveStream pcmStream = WaveFormatConversionStream.CreatePcmStream(reader))
        {
            WaveFileWriter.CreateWaveFile(outputFile, pcmStream);
        }
    }
}

… and that’s all there is to it.

Notes:

  1. There is no need to wrap pcmStream with a BlockAlignReductionStream since we are not repositioning the MP3 file, just reading it from start to finish.
  2. It uses the ACM MP3 decoder that comes with Windows to decompress the MP3 data.
  3. To be able to pass the MP3 data to the ACM converter we need to do some parsing of the MP3 file itself (specifically the MP3 frames and ID3 tags). Unfortunately, there are some MP3 files that NAudio cannot parse (notably the sample ones that come with Windows 7). My attempts at tracking down the cause of this problem have so far failed. (the basic issue is that after reading the ID3v2 tag, we don’t end up in the right place in the MP3 file to read a valid MP3Frame – see MP3FileReader.cs). Please let me know if you think you have a solution to this.


First, make sure that you are on the server computer. You can check by searching for "SQL server management studio" in windows. If it show's up then you're on the server.

How to find internal IP address (local network connection).

1. Hold the windows key on your keyboard and then press the "R" key to open up the "Run" box.

2. Type "cmd" into the text box and then click "OK".

3. In the black box that comes up type "ipconfig".

4. Look for the title "Ethernet adapter" and look for "IPV4 address", this is your local IP address. (The title may be "Wireless adapter" if you are on a wireless internet connection).

How to find external IP address (Internet connection).

1. Open up your internet browser of choice (Example: Internet explorer, Mozilla Firefox, Google Chrome) and go to www.canyouseeme.org.

2. This will display your external IP address. It will also allow you to check whether your port is open. Your SQL port must be open to be able to connect over the internet (Usually port 1444).

How to check which port SQL is using and whether it is open.

1. Go into windows file explorer and right-click "This PC" then click "Manage".

2. Navigate to "Protocols for MSSQLSERVER" by expanding "Services and Applications", "SQL server Configuration Manager", "SQL Server Network Configuration" and select "Protocols for MSSQLSERVER".

3. Right-click "TCP/IP" and select "Properties".

4. Go to the "IP Addresses" tab and scroll to the bottom until you see "TCP port". This is what port SQL is using.

5. In your internet browser go to www.canyouseeme.org. Put the port that you saw in the last step into the port field and click "Check Port".

If your port is closed it will look like this:                                                                         If your port is open it will look like this:

If your port is closed you will need to contact AmberPOS support to open it up for you.

Where to put the IP address into AmberPOS

When launching AmberPOS after a database connection failure it will launch into this screen:

Just populate the "Server IP, Port" field with the server IP address and the port separated by a comma.

Note: Only use the external IP address when connecting to a remote server that is at another location.


Wave 파일 압축 코덱 비교

오디오 압축 관리

PCM, GSM, ADPCM, CELP, SBC, TrueSpeech, 및 MPEG Layer-3 등의 오디오 압축 관리자를 사용하여 ".wav" 및 ".dct"에 사용할 수 있는 다양한 wave 압축 코덱의 오디오 품질과 압축 비트 레이트의 목록입니다. 참고: 오디오 압축 관리자 (ACM)는 .wav (wave) 또는 .dct (dictation) 파일로 녹음할 때 사용됩니다. 기타 포맷에 대해서는 사운드 파일 포맷 페이지를 참조하십시오.

ACM을 사용하는 제품:

이 페이지에 기재되어 있는 오디오 파일의 압축 형식은 낮은 비트레이트 오디오 형식입니다. 높은 비트레이트의 음악 및 방송 음성 포맷은 표시되지 않았습니다.

각각의 오디오 형식의 샘플을 청취하려면, "견본" 링크를 클릭하십시오.

형식

비트레이트

1분 =

견본

11,025Hz 16비트 PCM176.4kbs1292k11k16bitpcm.wav
8000Hz 16비트 PCM128kbs937.5k8k16bitpcm.wav
11,025Hz 8비트 PCM88.2kbs646k11k8bitpcm.wav
11,025Hz u-Law88.2kbs646k11kulaw.wav
8,000Hz 8비트 PCM64kbs468.8k8k8bitpcm.wav
8,000Hz u-Law
*회선 전화 품질
64kbs468.8k8kulaw.wav
11,025Hz 4비트 ADPCM44.1kbs323k11kadpcm.wav
8000Hz 4비트 ADPCM32kbs234.4k8kadpcm.wav
11,025Hz GSM6.1018kbs131.8k11kgsm.wav
8000Hz Mp3 16k16kbs117k8kmp316.wav
8,000Hz GSM6.10
* 휴대 전화 품질
13kbs102.5k8kgsm.wav
8000Hz Lernout & Hauspie SBC 12k12.0kbs87.9k8ksbc12.wav
8,000Hz DSP Group TrueSpeech9kbs65.9k8ktruespeech.wav
8000Hz Mp3 8k8kbs60k8kmp38.wav
8,000Hz Lernout & Hauspie CELP4.8kbs35k8kcelp.wav

댓글

위에 열거한 것들은 wave 파일들입니다 - mp3 코덱을 포함하더라도 ".wav" 또는 ".dct" 확장자가 붙습니다. 다른 파일 포맷의 개요에 대해서는, 사운드 파일 포맷 페이지를 참조하십시오.

추천 코덱

현재 NCH 소프트웨어는 음성 녹음의 경우에 GSM6.10 8000Hz를 권장하고 있습니다.

형식 문제

Windows 2000/XP에 포함된 "마이크로 소프트 G.723.1"는 ACM 코덱에 버그가 있기 때문에 인코딩 / 리코딩에 사용할 수 없습니다. 이 포맷은 사용하지 마십시오.

토론 포럼

ACM 코덱에 대한 질문이나 또는 관심이 있다면, 사운드 포맷 토론 포럼을 참조하십시오.

ACM을 지원하는 소프트웨어

많은 NCH 소프트웨어 전문 오디오 소프트웨어 응용 프로그램은 오디오 압축 관리자를 포함하고 있습니다:


'Knowledge' 카테고리의 다른 글

PSTN  (0) 2018.03.04
C# Winforms Message Box  (0) 2018.03.04
[mysql] 트랜젝션  (0) 2018.02.23
DataGrip 사용법 페이지  (0) 2018.02.23
G.711  (0) 2018.02.21

One question that commonly gets asked with NAudio is, “Why do I get a NoDriver calling acmFormatSuggest error when playing MP3s?” The answer is that you don’t have the ACM MP3 decoder installed. If you’re running a regular desktop version of windows from XP all the way up to 8.1, then the Fraunhofer MP3 ACM decoder is installed as standard and everything should just work.

But if you’re running a server version of Windows (or maybe one of the “N” versions of Windows sold in Europe), then you might be missing the codecs you need. There are various workarounds to this:

Option 1: Install Desktop Experience

If you are running Windows Server, make sure you install the “Desktop Experience” component of Windows. This will install all the standard codecs, for audio playback (including Media Foundation support as well). To install on Azure, this script may be helpful.

Option 2: Use the DMO MP3 Frame Decompressor

The NAudio Mp3FileReader class allows you to inject an alternative MP3 frame decompressor, so you don’t need to use ACM if you don’t want to. To use the DMO MP3 frame decompressor for example, use the following code:

new Mp3FileReader(stream,wave=> new DmoMp3FrameDecompressor(wave));

Option 3: Use MediaFoundationReader Instead

With NAudio 1.7, the MediaFoundationReader class was introduced, which can not only play MP3 files, but lots of other formats too. In many ways, this should now be the preferred way of playing MP3s with NAudio. You will still need the Desktop Experience installed if you’re on Windows Server though.

Option 4: Use a fully managed MP3 Decoder

Another option is to switch to fully managed MP3 decoder such as NLayer. This has the benefit of working on all platforms and requiring no codecs.

Option 5: Find and install another ACM MP3 Codec

Finally, you may be here not because you’re playing MP3, but because you tried to play a WAV file containing some codec that your system cannot find an ACM driver for. This also results in the “NoDriver calling acmFormatSuggest error”. What you need to do is search the web for an ACM codec that can decode the format you are using. Unfortunately this is not always a simple process, but unless you have a codec installed that matches the compression type of the file you’re trying to play, you won’t be able to play it.


mysql transaction


트랜잭션을 알아보기 이전에 먼저 엔진을 확인해야 합니다.

MySQL에는 많은 엔진이 있지만 대표적으로 InnoDB와 MyISAM을 사용하고 있는데요

InnoDB인 경우에만 트랜잭션을 사용할 수 있습니다


트랜잭션이란 쉽게 설명해드리면 은행 입출금을 생각해볼 수 있습니다

A라는 사람이 B한데 10만원을 송금하는 과정에서 A계좌에서 -10만원을 하고 B계좌에 +10만원하는 과정에서 오류가 나면 A계좌에만 10만원이 빠져있는 현상이 발생하겠죠

그래서 필요한게 트랜잭션입니다

트랜잭션은 여러 단계의 처리를 하나의 처리처럼 다루는 기능입니다.

트랜잭션의 실행 결과를 데이터베이스에 반영하는것을 커밋(commit), 다시 이전으로 되돌리는 것을 롤백(rollback)이라고 합니다


트랜잭션 시작하기

> START TRANSACTION;

> A 계좌에 -10만원

> B 계좌에 +10만원

> COMMIT

결과 : A계좌에 10만원이 빠져나가있고 B계좌에 10만원이 들어와있음


> START TRANSACTION;

> A 계좌에 -10만원

> B 계좌에 +10만원

> ROLLBACK

결과 : A,B계좌 금액 변동 없음


트랜잭션은 기본적으로 자동커밋을 사용하고 있습니다.

이를 OFF로 하기 위해서는

> set autocommit=0;

을 실행하면 됩니다.


만약에 데이터베이스를 여럿이서 공유하고 있다면 set autocommit을 수행하면 다른 사람들에게는 꼭 알려줘야겠죠?

그래서 데이터베이스에서 직접 바꾸는 것이 아닌 코드상에서 자동커밋을 막고 하는걸 권해드립니다


단, 아래의 쿼리는 트랜잭션을 지원하지 않으니 주의해주세요

* DROP DATABASE

* DROP TABLE

* DROP

* ALTER TABLE

[출처] mysql transaction|작성자 티딩


'Knowledge' 카테고리의 다른 글

PSTN  (0) 2018.03.04
C# Winforms Message Box  (0) 2018.03.04
Wave 파일 압축 코덱 비교  (0) 2018.02.24
DataGrip 사용법 페이지  (0) 2018.02.23
G.711  (0) 2018.02.21

해당 페이지에 가면 다른 사용법을 터득할 수 있다.


https://www.jetbrains.com/datagrip/whatsnew/#executing-queries



Executing queries

DataGrip now prompts you to choose a database/schema along with a data source when you try to run an SQL file from the context menu.

A similar enhancement: the list of data sources with related consoles will appear when attaching the console to a file.

There was only one Execute action before; now there are three of them. Change the behavior, and assign shortcuts: they are completely independent. For example, you can create an action which will execute the whole script, without having to choose the exact query from the script.

There is a small improvement for those who didn’t like to use the mouse to choose the schema of the console or the search path. Now there is an action called Set Current Schema. You can invoke it from Find Action(Ctrl+Shift+A).

Or just assign a shortcut! For example, Ctrl+Up can work. And you’ll be able to switch the context for the query console.


'Knowledge' 카테고리의 다른 글

PSTN  (0) 2018.03.04
C# Winforms Message Box  (0) 2018.03.04
Wave 파일 압축 코덱 비교  (0) 2018.02.24
[mysql] 트랜젝션  (0) 2018.02.23
G.711  (0) 2018.02.21

G.711

위키백과, 우리 모두의 백과사전.
이동: 둘러보기, 검색

G.711ITU-T의 오디오 컴팬딩을 위한 표준이다. 주로 전화에서 많이 쓰인다. 공식적인 명칭은 '음성 주파수의 펄스 부호 변조(PCM)'이다. G.711은 또한 IP 네트워크 상의 팩스 통신에도 사용된다. 펄스 부호 변조(PCM)으로도 알려져 있는 G.711은 파형 코덱으로 자주 사용된다. G.711은 64 kbit/s에서 시외 전화 정도의 품질을 제공하는 협대역 오디오 코덱이다. G.711은 300-3400 Hz 범위의 오디오 신호를 통과시키며 초당 8000샘플링의 레이트로 샘플링한다.

G.711에는 두가지 강화 버전이 있는데 G.711.0과 G.711.1이다. G.711.0은 대역폭 사용을 줄이기 위해 무손실 데이터 압축을 활용한다. G.711.1은 대역폭을 크게 하여 오디오 품질을 증가시킨다.

기능[편집]

  • 샘플링 주파수 8 kHz
  • 64 kbit/s 비트레이트(8kHz 샘플링 주파수 x 8 비트/샘플 수)
  • 형식적 알고리즘 지연 시간은 0.125 ms이며 look-ahead 지연은 없음.
  • G.711은 파형 음성 코더
  • G.711 부록 I은 패킷화된 네트워크에서 전송 손실을 숨기는 것을 도와주는 패킷 손실 은폐(PLC) 알고리즘을 정의한다.
  • G.711 부록 II는 무음 상태일 때 대역폭 사용을 줄이기 위해 음성 활동 감지(VAD)와 안정 소음 발생(CNG)를 사용하는 불연속 전송(DTX) 알고리즘을 정의한다.
  • 이상적인 조건 하에서 테스트 했을 때 PSQM은 G.711 μ-law가 4.45점, G.711 A-law가 4.45점의 평균 오피니언 평점을 도출해냈다.
  • 네트워크 부하 상태에서 테스트 했을 때 PSQM은 G.711 μ-law가 4.13점, G.711 A-law가 4.11점의 평균 오피니언 평점을 도출해냈다.

라이선스[편집]

G.711이 1972년에 발표됐기 때문에 특허는 이미 사라진지 오래되었다. 그러므로 자유롭게 사용가능하다.[1]


'Knowledge' 카테고리의 다른 글

PSTN  (0) 2018.03.04
C# Winforms Message Box  (0) 2018.03.04
Wave 파일 압축 코덱 비교  (0) 2018.02.24
[mysql] 트랜젝션  (0) 2018.02.23
DataGrip 사용법 페이지  (0) 2018.02.23


'메모' 카테고리의 다른 글

[스크랩] 데이비드 헨리 소우로  (0) 2018.03.26
[스크랩] 로크와 홈스 사회계약설  (0) 2018.03.25
아이디어 0117  (0) 2018.01.17

+ Recent posts