সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
এই পৃষ্ঠার বিষয়বস্তু হার্ডওয়্যার-নির্ভর। নিম্নলিখিত থেকে নির্বাচন করুন:
নমুনা চালানোর আগে, আপনাকে অবশ্যই রাস্পবেরি পাইতে অডিও সিস্টেমটি কনফিগার করতে হবে।
আপনার রেকর্ডিং এবং প্লেব্যাক ডিভাইস খুঁজুন.
ক্যাপচার হার্ডওয়্যার ডিভাইসের তালিকায় আপনার USB মাইক্রোফোন খুঁজুন। কার্ড নম্বর এবং ডিভাইস নম্বর লিখুন।
arecord -l
প্লেব্যাক হার্ডওয়্যার ডিভাইসের তালিকায় আপনার স্পিকার সনাক্ত করুন। কার্ড নম্বর এবং ডিভাইস নম্বর লিখুন। দ্রষ্টব্য যে 3.5mm-জ্যাকটি সাধারণত Analog বা bcm2835 ALSA ( bcm2835 IEC958/HDMI নয়) লেবেলযুক্ত।
aplay -l
হোম ডিরেক্টরিতে .asoundrc নামে একটি নতুন ফাইল তৈরি করুন ( /home/pi )। নিশ্চিত করুন যে এটি মাইক্রোফোন এবং স্পিকারের জন্য সঠিক স্লেভ সংজ্ঞা আছে; নীচের কনফিগারেশনটি ব্যবহার করুন তবে <card number> এবং <device number> আগের ধাপে যে নম্বরগুলি লিখেছিলেন তা দিয়ে প্রতিস্থাপন করুন। pcm.mic এবং pcm.speaker উভয়ের জন্যই এটি করুন।
এটি পুনরায় প্লে করে রেকর্ডিং পরীক্ষা করুন। আপনি কিছু শুনতে না পেলে, আপনাকে alsamixer এ রেকর্ডিং ভলিউম পরীক্ষা করতে হতে পারে।
aplay --format=S16_LE --rate=16000 out.raw
যদি রেকর্ডিং এবং প্লেব্যাক কাজ করে, তাহলে আপনি অডিও কনফিগার করে ফেলেছেন। যদি না হয়, মাইক্রোফোন এবং স্পিকার সঠিকভাবে সংযুক্ত আছে কিনা তা পরীক্ষা করুন৷ যদি এটি সমস্যা না হয়, তাহলে একটি ভিন্ন মাইক্রোফোন বা স্পিকার চেষ্টা করুন।
মনে রাখবেন যে আপনার যদি একটি HDMI মনিটর এবং একটি 3.5 মিমি জ্যাক স্পিকার উভয়ই সংযুক্ত থাকে তবে আপনি যেকোনো একটির মধ্যে অডিও চালাতে পারেন। নিম্নলিখিত কমান্ড চালান:
sudo raspi-config
উন্নত বিকল্প > অডিওতে যান এবং পছন্দসই আউটপুট ডিভাইস নির্বাচন করুন।
[null,null,["2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eThe Google Assistant Library for Python is deprecated; use the Google Assistant Service instead.\u003c/p\u003e\n"],["\u003cp\u003eThis guide provides instructions to configure audio on Raspberry Pi for use with Google Assistant.\u003c/p\u003e\n"],["\u003cp\u003eUsers need to identify and configure their microphone and speaker devices using provided commands.\u003c/p\u003e\n"],["\u003cp\u003eVerify audio setup by testing playback and recording functionalities with given commands.\u003c/p\u003e\n"],["\u003cp\u003eUpon successful audio configuration, proceed to configure a developer project and account settings.\u003c/p\u003e\n"]]],["The content outlines configuring audio for hardware, specifically on a Raspberry Pi. Key actions include identifying microphone and speaker devices using `arecord -l` and `aplay -l`, and noting their card and device numbers. Then create `.asoundrc` file and update it with specific hardware details. Users then verify audio functionality by adjusting volume using `alsamixer`, testing playback with `speaker-test`, and testing recording using `arecord` and `aplay`. Lastly a command `sudo raspi-config` is suggested to choose the audio output.\n"],null,["# Configure and Test the Audio\n\n| **Warning:** The Google Assistant Library for Python is deprecated as of June 28th, 2019. Use the [Google Assistant Service](/assistant/sdk/guides/service/python) instead.\n\n\u003cbr /\u003e\n\nThe content on this page is hardware-dependent. Please select from the following: \nRaspberry Pi 3 Ubuntu Desktop Other Linux-based platforms\nBefore running the sample, you must configure the audio system on the Raspberry Pi.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n1. Find your recording and playback devices.\n\n 1. Locate your USB microphone in the list of capture hardware devices. Write\n down the card number and device number.\n\n ```\n arecord -l\n ```\n\n \u003cbr /\u003e\n\n 2. Locate your speaker in the list of playback hardware devices. Write down\n the card number and device number. Note that the 3.5mm-jack is typically\n labeled `Analog` or `bcm2835 ALSA` (not `bcm2835 IEC958/HDMI`).\n\n ```\n aplay -l\n ```\n\n \u003cbr /\u003e\n\n2. Create a new file named `.asoundrc` in the home directory (`/home/pi`). Make\n sure it has the right slave definitions for microphone and speaker; use the\n configuration below but replace `\u003ccard number\u003e` and `\u003cdevice number\u003e` with\n the numbers you wrote down in the previous step. Do this for both `pcm.mic`\n and `pcm.speaker`.\n\n pcm.!default {\n type asym\n capture.pcm \"mic\"\n playback.pcm \"speaker\"\n }\n pcm.mic {\n type plug\n slave {\n pcm \"hw:\u003ccard number\u003e,\u003cdevice number\u003e\"\n }\n }\n pcm.speaker {\n type plug\n slave {\n pcm \"hw:\u003ccard number\u003e,\u003cdevice number\u003e\"\n }\n }\n\n3. Verify that recording and playback work:\n\n 1. Adjust the playback volume.\n\n ```\n alsamixer\n ```\n\n \u003cbr /\u003e\n\n Press the up arrow key to set the playback volume level to around 70.\n 2. Play a test sound (this will be a person speaking). Press Ctrl+C when\n done. If you don't hear anything when you run this, check your speaker\n connection.\n\n ```\n speaker-test -t wav\n ```\n\n \u003cbr /\u003e\n\n 3. Record a short audio clip.\n\n ```\n arecord --format=S16_LE --duration=5 --rate=16000 --file-type=raw out.raw\n ```\n\n \u003cbr /\u003e\n\n 4. Check the recording by replaying it. If you don't hear anything, you may\n need to check the recording volume in `alsamixer`.\n\n ```\n aplay --format=S16_LE --rate=16000 out.raw\n ```\n\n \u003cbr /\u003e\n\n If recording and playback are working, then you are done configuring audio.\n If not, check that the microphone and speaker are properly connected. If\n this is not the issue, then try a different microphone or speaker.\n\n Note that if you have both an HDMI monitor and a 3.5mm jack speaker\n connected, you can play audio out of either one. Run the following command: \n\n ```\n sudo raspi-config\n ```\n\n Go to **Advanced options \\\u003e Audio** and select the desired output device.\n\nNext step\n---------\n\n[Configure a Developer Project and Account Settings](/assistant/sdk/guides/library/python/embed/config-dev-project-and-account)"]]