Advertisement
Guest User

Change sample rate Raspberian

a guest
Jan 9th, 2021
1,079
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. (If you dont know how to use vim, I will explain what to do, but these websites might help out: https://coderwall.com/p/adv71w/basic-vim-commands-for-getting-started and https://www.thegeekstuff.com/2009/03/8-essential-vim-editor-navigation-fundamentals/
  2. "-->" means enter in to the console
  3.  
  4. To change the sample rate in Raspberian/Linux we have to change the pulse config file.
  5. First navigate to /etc/pulse/daemon.conf:
  6. --> cd /etc/pulse
  7.  
  8. We know have to open the file with vim and edit its contents. Because it is a read-only file we access this as a superuser.
  9. --> sudo vi daemon.conf
  10.  
  11. Know we have opened the file using vim we need to navigate to the correct spot in the file.
  12. To navigate the file we use the following keys:
  13. k – navigate upwards
  14. j – navigate downwards
  15. l – navigate right side
  16. h – navigate left side
  17.  
  18. We want to navigate to the line: "; alternate-sample-rate = 48000"
  19. Navigate the cursor to the "48000" and press 'x' to remove the string figure by figure.
  20. Now, make sure the cursor is at the end of the line. So behind the "=".
  21. After this, we press 'i' to enter text edit mode and enter the value "16000".
  22. To exit text edit mode we press 'esc'.
  23.  
  24. The block of text in which the line you have to edit is in should look like this:
  25.  
  26. "
  27.  
  28. ; default-sample-format = s16le
  29. ; default-sample-rate = 44100
  30. alternate-sample-rate = 16000
  31. ; default-sample-channels = 2
  32. ; default-channel-map = front-left,front-right
  33.  
  34. "
  35.  
  36.  
  37. Now we save and quit vim.
  38. Save the file by entering ':w!' and exit vim by entering ':q'
  39.  
  40. To be sure the edit worked, print the file's contents and check if the edit is there.
  41. --> cat daemon.conf
  42.  
  43. If the edit is there,
  44. Congrats you did it!
  45.  
  46. Just make sure that you restart pulse once:
  47. --> pulseaudio -k
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement