使用playStream()时,““文件”参数必须为非空字符串“错误

时间:2018-10-12 18:00:15

标签: node.js discord.js

我遇到"file" argument must be a non-empty string 函数的问题。
流无法播放,并且出现以下错误:

args[0]

是的,我确定'youtube.com/watch?v=A02s8omM_hI'被定义为stream,并且PassThrough的日志被记录为var stream = ytdl(args[0], { filter: "audioonly" }); message.member.voiceChannel.join().then(connection => { const dispatcher = connection.playStream(stream); dispatcher.on("error", (error) => { console.log(error); }); dispatcher.on("end", () => { console.log("Song ended!"); }); }); console)。

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct Test
{
  int id;
};

typedef struct Node {
  struct Test structure;
  struct Node * next;
  struct Node *prev;

}TNode;
typedef TNode* Node;

void NewNode(struct Test  p, Node *pp)
{
  Node temp;

  temp = (Node)malloc(sizeof(struct Node));

  temp->structure = p;
  temp->next = *pp;
  temp->prev = NULL;

  if(*pp != NULL)
  {
    (*pp)->prev = temp;
  }

  *pp = temp;

}

void ReadStructure(struct Test * p)
{
  printf("\nID:");
  scanf(" %d", &p->id);
}

void ViewList(Node node)
{
  Node temp;
  while(node != NULL)
  {
    temp = node->prev;
    if(node->prev == NULL)
      {
        printf("Prev = NULL\n");
      }
    else
    {
    printf("Prev: %d\n", temp->structure.id);
    }
    printf("Curr: %d\n", node->structure.id);
    node = node->next;
  }
}

void Delete(Node * head, Node del)
{

       if(*head == NULL || del == NULL)
        {
          return;
        }
       if(*head == del)
       {
         *head = del->next;
       }
       if(del->next != NULL)
       {
         del->next->prev = del->prev;
       }
       if(del->prev != NULL)
       {
         del->prev->next = del->next;
       }
       free(del);
       return;

}

int Menu()
{
  int c;

  printf("*** M E N U ***\n"
     "1 - New Node\n"
     "2 - View List\n"
   "3 - Delete\n"
   "0 - Exit\n"
  "\n>> ");
  scanf(" %d", &c);

  return c;
}

int main()
{
  int c;
  struct Test test;
  Node list = NULL;
  Node del = NULL;
  do {
    c = Menu();

    switch (c)
    {
      case 1: ReadStructure(&test);
              NewNode(test, &list); break;
      case 2: ViewList(list); break;
      case 3: printf("\nElement to Delete: ");
              scanf("%d", &del->structure.id);
              Delete(&list, del); break;
      default: c = 0;
    }

  } while (c != 0);

  return 0;
}

很遗憾,我在互联网上找不到与我的问题有关的任何解决方案。
预先感谢!

1 个答案:

答案 0 :(得分:0)

也许您已经传递了一个空字符串作为输出文件?

docs:

  

-o FILE,--output FILE保存到文件,模板为{prop},默认值:stdout