The cafe (of learning) never closes
For finance related posts, go to http://mymoneyrules.blogspot.in/
Wednesday, January 2, 2019
Configure and test audio on the Pi
- Please follow prior steps to install Raspbian.
- Connect the USB microphone and 3.5mm jack speaker
- Go to the UI and
- Click on the Raspberry icon > Preferences> Audio Device settings
- Select "USB PnP Sound Device (Alsa Mixer)
- Click "Select Controls", select Microphone and make the Microphone audio to its highest.
- Run "sudo raspi-config" on the terminal
- Select "Advanced Options"
- Select "Audio"
- Select "Force 3.5mm headphone jack"
- Select "Finish"
Setting Mic and Audio controls:
- Run the command "aplay -l" (its -L lowercase) in the terminal
- Copy the card # and device # (for speaker)
- Run the command "arecord -l" (its -L lowercase) in the terminal
- Copy the card # and device # (for Mic)
- Open a new file under /home/pi
- vi .asoundrc
- Copy paste the below
pcm.!default {
type asym
capture.pcm "mic"
playback.pcm "speaker"
}
pcm.mic {
type plug
slave {
pcm "hw:1,0"
}
}
pcm.speaker {
type plug
slave {
pcm "hw:0,0"
}
}
In the above
pcm "hw:1,0" under pcm.mic is hw:<card#>,<device#>
Please use the correct one from aplay (Speaker) and arecord (Mic) as mentioned above.
Test Audio:
- ssh to the Pi (or run the commands directly on a terminal on the pi)
- Run the command "speaker-test -t wav"
- You should hear voice from the speaker
- Our speaker is configured.
Test Mic:
- ssh to the Pi (or run the commands directly on a terminal on the pi)
- Run the command
arecord --format=S16_LE --duration=10 --rate=16000 --file-type=raw out2.wav - Say something near the microphone for 10 sec [Note duration above is in seconds]
- To replay, run the command
-
aplay --format=S16_LE --rate=16000 out2.wav
Your Mic and speaker are now configured.
Labels:
assistant,
mic,
microphone,
Raspberry,
Raspberry Pi,
speaker,
voice
Wednesday, December 26, 2018
SSH to the Raspberry Pi
How to ssh and access the Pi remotely?
- On the Pi, go to the raspberry icon > Accessories > Terminal
- Run the command "ifconfig" and get the IpAddress.
- On your laptop terminal, run the ssh [Username: pi, Default password: raspberry]
- ssh pi@<ipaddress> to connect
You can also connect via VNC Viewer by providing the same IP Address.
Setting up and Installing Raspberry Pi
Hi All
Lets start with the basics of setting up Raspberry Pi.
Requirements:
Lets start with the basics of setting up Raspberry Pi.
Requirements:
- Raspberry Pi [https://www.amazon.com/dp/B01LWVVMUI/ref=as_li_ss_tl?psc=1&linkCode=ll1&tag=arduinopibake-20&linkId=619dd3e1a1daab389aa5a44dac22a276]
- If you have a VGA monitor, you would need a HDMI to VGA convertor [https://www.amazon.in/gp/product/B00S0C76GQ/ref=oh_aui_detailpage_o02_s00?ie=UTF8&psc=1]
- Keyboard, mouse and monitor.
Setting up SD Card for the Raspberry Pi
- Take the SD card and put it in the MicroSD -USB ADAPTER. Connect this to your laptop.
- Download Etcher software from https://www.balena.io/etcher/
- Download Raspbian from https://www.raspberrypi.org/downloads/raspbian/
- Now use Etcher to write to the flash drive
- Simple UI. Open Etcher
- Select the Raspbian zip file
- Select the drive
- Flash
Connecting and Starting Raspberry Pi
- Put the SD card in the Raspberry Pi.
- Connect the Raspberry Pi to the monitor.
- Connect the mouse and keyboard and power on the Raspberry Pi
- Once it boots, set up wifi on top right.
- Go to the Raspberry icon on top left and Go to Settings > Preferences> "Raspberry Pi Configuration" and make the changes in settings as shown in the images below.
- When you click OK, it will ask you to reboot the Pi and go ahead and reboot to Save the changes.
Sunday, November 15, 2015
How to change app icon in android studio?
How to change app icon in android studio?
We have the default icon for every app. But if we want to change the app icon, we need to do the following steps:
Get a 512*512 icon created (in png format). This is the main requirement.
In Android studio, right click on res folder (under app > src > main) and select "New > Image Asset"

Take the default image file folder and push in your new image (in that location).
Select the new image in the "Image File"option.
Click next and click finish.
You can also check the AndroidManifest.xml file if the "android:icon" value has changed or not.
You can also change the icon name there.
Your new icon will get reflected in the next code build.
We have the default icon for every app. But if we want to change the app icon, we need to do the following steps:
Get a 512*512 icon created (in png format). This is the main requirement.
In Android studio, right click on res folder (under app > src > main) and select "New > Image Asset"
Take the default image file folder and push in your new image (in that location).
Select the new image in the "Image File"option.
Click next and click finish.
You can also check the AndroidManifest.xml file if the "android:icon" value has changed or not.
You can also change the icon name there.
Your new icon will get reflected in the next code build.
How to change android version for successive deployments to google play store
How to change android version for successive deployments to google play store?
Once you have uploaded an apk file and if you fix a bug, you may need to re-upload (redeploy) your apk file to google play store.
One will need to update the version number of the release.
How do you do it?
In Android Studio, look for build.gradle under app (not under gradle)

Change the version code and version number to a higher value (default is 1)
Now proceed to generate a signed apk and upload the new apk to google play store.
Once you have uploaded an apk file and if you fix a bug, you may need to re-upload (redeploy) your apk file to google play store.
One will need to update the version number of the release.
How do you do it?
In Android Studio, look for build.gradle under app (not under gradle)
Change the version code and version number to a higher value (default is 1)
Now proceed to generate a signed apk and upload the new apk to google play store.
Subscribe to:
Posts (Atom)















