WM8731 CODEC Volume Control suggestion

Post your requests and ideas on the future development of mikroBasic PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
rmkumar
Posts: 10
Joined: 16 Nov 2015 07:53

WM8731 CODEC Volume Control suggestion

#1 Post by rmkumar » 16 Nov 2015 16:53

When WM8731 is configured as LINE_IN enabled and MIC muted,
WM8731_SetVolume from example code was creating problem. It is better to have two
different functions SetInputVolume and SetOutputVolume

Code: Select all

sub procedure WM8731_SetVolume(dim LeftCh, RightCh as byte)
dim temp as word

  if LeftCh > 80 then
    LeftCh = 80
  end if
  if RightCh > 80 then
    RightCh = 80
  end if
  
  temp = LeftCh + 0x00AF
  WM8731_CMD(WM8731_Reg_Lhphone_out, temp)      'left headphone out
  'WM8731_CMD(WM8731_REG_LLINE_IN, temp) 'Creates problem - mute Left LINE_IN when LINE_IN is enabled
  temp = RightCh + 0x00AF
  WM8731_CMD(WM8731_Reg_Rhphone_out, temp)     'right headphone out
  'WM8731_CMD(WM8731_REG_RLINE_IN, temp) 'Creates problem - mute RightLINE_IN when LINE_IN is enabled
end sub

Code: Select all

  'WM8731_CMD(WM8731_REG_LLINE_IN, temp) 'Creates problem - mute Left LINE_IN when LINE_IN is enabled

Code: Select all

  'WM8731_CMD(WM8731_REG_RLINE_IN, temp) 'Creates problem - mute Right LINE_IN when LINE_IN is enabled

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: WM8731 CODEC Volume Control suggestion

#2 Post by filip » 17 Nov 2015 15:21

Hi,

Thanks for sharing this. :)

Regards,
Filip.

Post Reply

Return to “mikroBasic PRO for dsPIC30/33 and PIC24 Wish List”