当前位置: 首页 > news >正文

使用ncmpcpp结合mpd更加容易听音乐

参考:https://ubuntuhandbook.org/index.php/2025/07/install-mpd-ubuntu/
使用ncmpcpp结合mpd更加容易听音乐

  1. 安装软件

    • sudo apt install mpd ncmpcpp
  2. 配置MPD

    • 配置服务器端

      • 用户:~/.config/mpd/mpd.conf
      • 系统:/etc/mpd.conf
    • 创建本地mpd目录:mkdir -p ~/.config/mpd

    • 创建本地播放列表:mkdir -p ~/.config/mpd/playlists

    • 编辑用户配置文件:sudo cp /etc/mpd.conf ~/.config/mpd/

      • 修改文件权限:sudo chown 666 ~/.config/mpd/mpd.conf

      • 修改文件:vim ~/.config/mpd/mpd.conf 系统则直接修改即可

      • 修改项目:

        • 目录:music_directory "/home/ji/Music/"

        • 文件:playlist_directory "/home/ji/.config/mpd/playlists"

        • 文件:db_file "/home/ji/.config/mpd/tag_cache"

        • 文件:state_file "/home/ji/.config/mpd/state"

        • 文件:sticker_file "/home/ji/.config/mpd/sticker.sql"

        • 文件:user "ji"

        • 文件:bind_to_address "localhost"

        • 文件:port "6600"

        • 声音输出文件:用户(.config/mpd/mpd.conf),系统(/etc/mpd.conf)

          • 文件部分audio_output

          • audio_output {type            "pulse"name            "My Pulse Output"server          "localhost"
            }
            
          • stream sound to multiple devices

          • 文件部分

          • audio_output {type            "httpd"name            "My HTTP Stream"
            #       encoder         "lame"          # optional, vorbis or lameport            "8802"bind_to_address "192.168.0.104"         # optional, IPv4 or IPv6
            }
            
          • 密码设置:password "selfmodifypass@read,add,control,admin"

      • 配置有线声音,This step is only required for running mpd as system service (rather than –user).

        • 修改配置文件:

        • 文件/etc/pipewire到用户目录

        • sudo mkdir -p /etc/pipewire
          sudo cp /usr/share/pipewire/pipewire-pulse.conf /etc/pipewire/
          sudo vim /etc/pipewire/pipewire-pulse.conf
          
        • 启动服务:systemctl --user restart pipewire pipewire-pulse wireplumber

        • 允许监听TCP接口,pulse.properties部分:务必将tcp:4713启用

        • 最后重启服务:systemctl --user restart pipewire pipewire-pulse wireplumber

      • 启动MPD守护进程:

        • 推荐:systemctl --user enable --now mpd, 此处的--user tells to enable it as user service, and --now means to start the service once enabled.
        • 也可以:sudo systemctl enable --now mpd
        • 失败则:systemctl --user status mpd,根据失败情况目录或文件修改即可,再次重启服务器systemctl restart --user mpd
  3. 配置ncmpcpp

  • 修改配置文件.config/ncmpcpp/config:

    ncmpcpp_directory = "/home/nicationw/WORKM/music/ncmpcpp"
    lyrics_directory = "/home/nicationw/WORKM/music/lyrics"
    mpd_host = "localhost"
    mpd_port = "6600"
    mpd_music_dir = "/home/nicationw/WORKM/music/mpd"
    mpd_connection_timeout = 5
    mpd_crossfade_time = 5#visualizer_data_source = LOCATION
    visualizer_output_name = myFifo
    visualizer_in_stereo = yes
    visualizer_type = spectrum
    visualizer_look = "+|"
    visualizer_color = 5
    #visualizer_fps = FPS
    visualizer_autoscale = yes
    visualizer_spectrum_smooth_look = yes
    visualizer_spectrum_dft_size = 4
    #visualizer_spectrum_gain = 10dB
    #visualizer_spectrum_hz_min = 1Hz
    #visualizer_spectrum_hz_max = 20000Hzsystem_encoding = utf-8
    message_delay_time = 5
    alternative_header_first_line_format = "$0$aqqu$/a {$7%a - $9}{$5%t$9}|{$8%f$9} $0$atqq$/a$9"
    alternative_header_second_line_format = "{{$6%b$9}{ [$6%y$9]}}|{%D}"
    #current_item_prefix = TEXT
    #current_item_suffix = TEXT
    #current_item_inactive_column_prefix = TEXT
    #current_item_inactive_column_suffix = TEXT
    #now_playing_prefix = TEXT
    #now_playing_suffix = TEXT
    #browser_playlist_prefix = TEXT
    selected_item_prefix = "* "
    #selected_item_suffix = TEXT
    #modified_item_prefix = TEXT
    #execute_on_song_change = COMMAND
    #execute_on_player_state_change = COMMANDplaylist_disable_highlight_delay = 0
    playlist_show_mpd_host = no
    playlist_show_remaining_time = no
    playlist_shorten_total_times = no
    playlist_separate_albums = no
    playlist_display_mode = classic
    browser_display_mode = classic
    search_engine_display_mode = classic
    playlist_editor_display_mode = classic
    discard_colors_if_item_is_selected = yes
    show_duplicate_tags = yes
    incremental_seeking = yes
    seek_time = 1
    volume_change_step = 10
    autocenter_mode = yes
    centered_cursor = yes
    #progressbar_look = TEXT
    default_place_to_search_in = database
    user_interface = classic
    data_fetching_delay = yes
    media_library_primary_tag = artist
    media_library_albums_split_by_date = no
    media_library_hide_album_dates = yes
    default_find_mode = wrapped
    #default_tag_editor_pattern = TEXT
    header_visibility = yes
    statusbar_visibility = yes
    connected_message_on_startup = yes
    titles_visibility = yes
    header_text_scrolling = yes
    cyclic_scrolling = yes
    #lyrics_fetchers = FETCHERS
    follow_now_playing_lyrics = yes
    fetch_lyrics_for_current_song_in_background = yes
    store_lyrics_in_song_dir = yes
    generate_win32_compatible_filenames = yes
    allow_for_physical_item_deletion = yes
    #lastfm_preferred_language = ISO 639 alpha-2 language code
    space_add_mode = add_remove
    show_hidden_files_in_local_browser = no
    #screen_switcher_mode = SWITCHER_MODE
    #startup_screen = SCREEN_NAME
    #startup_slave_screen = SCREEN_NAME
    startup_slave_screen_focus = no
    locked_screen_width_part = 56
    ask_for_locked_screen_width_part = yes
    jump_to_now_playing_song_at_start = yes
    ask_before_clearing_playlists = yes
    clock_display_seconds = yes
    display_volume_level = yes
    display_bitrate = yes
    display_remaining_time = yes
    regular_expressions = extended
    ignore_leading_the = yes
    ignore_diacritics = yes
    block_search_constraints_change_if_items_found = yes
    mouse_support = no
    mouse_list_scroll_whole_page = no
    lines_scrolled = 10
    empty_tag_marker = ""
    tags_separator = ", "
    tag_editor_extended_numeration = yes
    media_library_sort_by_mtime = yes
    enable_window_title = yes
    #search_engine_default_search_mode = MODE_NUMBER
    #external_editor = PATH
    use_console_editor = yes
    colors_enabled = yes
    empty_tag_color = 1
    header_window_color = 1
    volume_color = 4
    state_line_color = 6
    state_flags_color = 6
    main_window_color = 8
    color1 = 5
    color2 = 7
    progressbar_color = 3
    progressbar_elapsed_color = 1
    statusbar_color = 8
    statusbar_time_color = 2
    player_state_color = 4
    alternative_ui_separator_color = 7
    window_border_color = 8
    active_window_border = 2
    

    根据帮助文件设置,不会有错,只是没有那么好看而已。

http://www.jsqmd.com/news/285785/

相关文章:

  • Sketch为什么越来越少人用?UI设计工具的真实迁移方向
  • sparse4D V2核心要点
  • 学霸同款2026 AI论文工具TOP9:自考毕业论文全攻略
  • 计算机Java毕设实战-基于Spring Boot的企业人力资源管理系统基于springboot的寿险公司人力资源管理系统【完整源码+LW+部署说明+演示视频,全bao一条龙等】
  • sparse4D v3
  • 具备DI、DO、AI、AO四类IO信号的采集/输出功能以及串口、网口的通信功能,主要用于对综合测试平台及样机的功能测试提供支撑。
  • 计算机Java毕设实战-基于Spring Boot的保险销售员人力资源管理系统基于springboot的寿险公司人力资源管理系统【完整源码+LW+部署说明+演示视频,全bao一条龙等】
  • 用于测量个防产品中各种活门的动态数据,提取活门的动态特性,为产品的研发提供测试条件和数据支持
  • Java计算机毕设之基于Java+springboot的寿险公司人力资源管理系统基于SpringBoot的人力资源管理系统(完整前后端代码+说明文档+LW,调试定制等)
  • 【剑斩OFFER】算法的暴力美学——力扣 675 题:为高尔夫比赛砍树
  • 【课程设计/毕业设计】基于SpringBoot的人力资源管理系统基于springboot的寿险公司人力资源管理系统【附源码、数据库、万字文档】
  • 【毕业设计】基于springboot的社区协作与资源共享系统(源码+文档+远程调试,全bao定制等)
  • Java毕设选题推荐:基于SpringBoot的社区互助系统基于springboot的社区协作与资源共享系统【附源码、mysql、文档、调试+代码讲解+全bao等】
  • 想在 Java 八股文面试中脱颖而出?这1000 道互联网大厂 工程师面试题必不可少!!
  • PolarDB-X 企业版分布式集群部署文档
  • 【毕业设计】基于springboot的寿险公司人力资源管理系统(源码+文档+远程调试,全bao定制等)
  • 【课程设计/毕业设计】基于SpringBoot的闲置物品交易系统基于springboot的闲一品闲置品交易平台【附源码、数据库、万字文档】
  • 【2026亲测有效】10款免费降AI工具全解析,轻松将AIGC率降至10%以下
  • 如何利用天淳SCRM系统实现客户全生命周期高效管理?
  • 【课程设计/毕业设计】基于Springboot+Vue的社区资源共享系统设计与实现基于springboot的社区协作与资源共享系统【附源码、数据库、万字文档】
  • 担心AIGC率过高?10个降AI工具+免费技巧实现10%低AI率(详细攻略)
  • 道路抛洒物数据集4521张VOC+YOLO格式
  • TCP 流通信中的 EOFException 与 JSON 半包障碍解析
  • 消费kafka数据
  • 亲测有效:10个免费降AI工具+完整操作流程,成功将AIGC风险降至10%
  • 吉时利6517B 静电计/高阻表: 高精度电学测量的专业选择
  • 2026毕业生必备:用这10款降AI工具和免费降AI方法,高效降低论文AI率至10%
  • KEYSIGHT是德 N1912A功率计:宽带多通道功率测量的标杆之选
  • Java毕设选题推荐:基于springboot的闲一品闲置品交易平台【附源码、mysql、文档、调试+代码讲解+全bao等】
  • 搜维尔科技:【工业前沿——Tesollo】机器人工匠打造“点石成金”机械手