2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
샘플링 레이트 변환
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 도움말에서는 Android 내의 리샘플링이라는 샘플링 레이트 변환에 관해 설명합니다.
샘플링 레이트 변환과 관련된 용어는 용어를 참고하세요.
샘플링 레이트 변환은 한 샘플링 레이트의 개별 샘플 스트림을 다른 샘플링 레이트의 또 다른 스트림으로 변경하는 프로세스입니다.
리샘플러라고도 하는 샘플링 레이트 변환기는 샘플링 레이트 변환을 구현하는 모듈입니다. 리샘플러와 관련하여 원본 스트림은 소스 신호라 하고 리샘플링된 스트림은 싱크 신호라고 합니다.
리샘플러는 Android의 여러 위치에서 사용됩니다. 예를 들어 MP3 파일이 44.1kHz 샘플링 레이트로 인코딩되는데, 내부적으로 48kHz 오디오를 지원하는 Android 기기에서 재생되어야 한다고 가정합니다. 이 경우 리샘플러는 MP3 출력 오디오를 44.1kHz 소스 샘플링 레이트에서 Android 기기 내에서 사용되는 48kHz 싱크 샘플링 레이트로 업샘플링하는 데 사용될 수 있습니다.
리샘플러의 특성은 다음과 같은 측정항목을 사용하여 표현할 수 있습니다.
- 신호의 총 진폭 보존 정도
- 싱크 샘플링 레이트의 제한사항에 따른 신호의 주파수 대역폭 보존 정도
- 리샘플러로 인한 총 지연 시간
- 주파수와 관련하여 일관적인 위상 및 그룹 지연
- CPU 주기 또는 전력 사용량에서 표현되는 계산 복잡성
- 소스 및 싱크 샘플링 레이트의 허용 비율
- 샘플링 레이트 비율을 동적으로 변경하는 기능
- 지원되는 디지털 오디오 샘플 형식
이상적인 리샘플러는 소스 신호의 진폭 및 주파수 대역폭을 정확히 보존하고(싱크 샘플링 레이트의 제한사항에 따름) 지연을 최소한으로 그리고 일관되게 유지합니다. 또한 계산 복잡성을 최소화하고 임의 및 동적 변환 비율을 허용하며 일반적인 모든 디지털 오디오 샘플 형식을 지원합니다. 실제 리샘플러에서는 이러한 특성이 절충되므로 현실에서 이상적인 리샘플러는 존재하지 않습니다. 예를 들어 이상적인 품질을 목표로 하면 짧은 지연과 낮은 복잡성을 어느 정도 포기해야 합니다.
Android에는 다양한 오디오 리샘플러가 포함되어 있어 애플리케이션 사용 사례 및 로드에 따라 적절한 절충이 이루어질 수 있습니다. 사용 가능한 리샘플러는 리샘플러 구현에 설명되어 있습니다.
리샘플러 구현
사용 가능한 리샘플러 구현은 자주 변경되며 OEM에서 맞춤설정할 수 있습니다.
신호 왜곡의 내림차순 및 계산 복잡도의 오름차순이 적용된 기본 리샘플러에는 다음이 포함됩니다.
- 선형
- 3차
- 원본 계수가 있는 싱크
- 수정된 계수가 있는 싱크
일반적으로 싱크 리샘플러는 고품질 음악 재생에 더 적합하기 때문에 품질이 덜 중요한 경우에는 다른 리샘플러를 예약해야 합니다(예: '키 클릭' 등).
선택한 특정 리샘플러 구현은 사용 사례, 로드, 시스템 속성 af.resampler.quality
의 값에 따라 다릅니다. 자세한 내용은 AudioFlinger의 오디오 리샘플러 소스 코드를 참고하세요.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-03-26(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-03-26(UTC)"],[],[],null,["# Sample rate conversion\n\nThis article describes sample rate conversion, also known as *resampling* , within Android.\nFor terminology related to sample rate conversion, see\n[Terminology](/docs/core/audio/terminology#srcTerms).\n\n\nSample rate conversion is the process of changing a stream of discrete samples\nfrom one sample rate to another stream at a different sample rate.\nA sample rate converter, or resampler, is a module that implements sample rate\nconversion. With respect to the resampler, the original stream is called the\nsource signal, and the resampled stream is called the sink signal.\n\n\nResamplers are used in several places in Android. For example, an MP3 file may\nbe encoded at 44.1 kHz sample rate but needs to be played back on an Android\ndevice supporting 48 kHz audio internally. In that case, a resampler would be\nused to upsample the MP3 output audio from 44.1 kHz source sample rate to a\n48 kHz sink sample rate used within the Android device.\n\n\nThe characteristics of a resampler can be expressed using metrics, including:\n\n- degree of preservation of the overall amplitude of the signal\n- degree of preservation of the frequency bandwidth of the signal, subject to limitations of the sink sample rate\n- overall latency through the resampler\n- consistent phase and group delay with respect to frequency\n- computational complexity, expressed in CPU cycles or power draw\n- permitted ratios of source and sink sample rates\n- ability to dynamically change sample rate ratios\n- which digital audio sample formats are supported\n\n\nThe ideal resampler would exactly preserve the source signal's amplitude\nand frequency bandwidth (subject to limitations of the sink\nsample rate), have minimal and consistent delay, have minimal\ncomputational complexity, permit arbitrary and dynamic conversion ratios,\nand support all common digital audio sample formats. In practice, ideal\nresamplers do not exist as actual resamplers are a compromise among these\ncharacteristics. For example, goals of ideal quality conflict with short delay\nand low complexity.\n\n\nAndroid includes a variety of audio resamplers, so that appropriate\ncompromises can be made depending on the application use case and load. The\navailable resamplers are explained in [Resampler implementation.](#srcResamplers)\n\nResampler implementations\n-------------------------\n\n\nAvailable resampler implementations change frequently,\nand may be customized by OEMs.\nThe default resamplers, in descending order of signal distortion and ascending order of\ncomputational complexity, include:\n\n- linear\n- cubic\n- sinc with original coefficients\n- sinc with revised coefficients\n\n\nIn general, the sinc resamplers are more appropriate for higher-quality\nmusic playback, and the other resamplers should be reserved for cases\nwhere quality is less important (an example might be \"key clicks\" or similar).\n\n\nThe specific resampler implementation selected depends on\nthe use case, load, and the value of system property\n`af.resampler.quality`. For details,\nconsult the audio resampler source code in\n[AudioFlinger](https://android.googlesource.com/platform/frameworks/av/+/39ec5a7accf61d89a41908999bc789d5c8d0e3d3/services/audioflinger/)."]]